diff --git a/build/jQuery.SPServices-2.0.0-pre-alpha.js b/build/jQuery.SPServices-2.0.0-pre-alpha.js new file mode 100644 index 0000000..c697388 --- /dev/null +++ b/build/jQuery.SPServices-2.0.0-pre-alpha.js @@ -0,0 +1,6184 @@ +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +/** + * Original SPServices core modules... + */ +define([ + "jquery", + "../utils/constants", + "../core/SPServices.utils" +], function ( + $, + constants, + utils +) { + + /* jshint undef: true */ + + "use strict"; + + var SOAPAction = ""; + var SOAPEnvelope = { + header: "", + footer: "", + payload: "" + }; + + // Caching + var promisesCache = {}; + + // Web Service names + var webServices = { + ALERTS: "Alerts", + AUTHENTICATION: "Authentication", + COPY: "Copy", + FORMS: "Forms", + LISTS: "Lists", + MEETINGS: "Meetings", + OFFICIALFILE: "OfficialFile", + PEOPLE: "People", + PERMISSIONS: "Permissions", + PUBLISHEDLINKSSERVICE: "PublishedLinksService", + SEARCH: "Search", + SHAREPOINTDIAGNOSTICS: "SharePointDiagnostics", + SITEDATA: "SiteData", + SITES: "Sites", + SOCIALDATASERVICE: "SocialDataService", + SPELLCHECK: "SpellCheck", + TAXONOMYSERVICE: "TaxonomyClientService", + USERGROUP: "usergroup", + USERPROFILESERVICE: "UserProfileService", + VERSIONS: "Versions", + VIEWS: "Views", + WEBPARTPAGES: "WebPartPages", + WEBS: "Webs", + WORKFLOW: "Workflow", + /* Nintex Web Service*/ + NINTEXWORKFLOW: "NintexWorkflow/Workflow" + }; + + var encodeOptionList = ["listName", "description"]; // Used to encode options which may contain special characters + + + // Array to store Web Service information + // WSops.OpName = [WebService, needs_SOAPAction]; + // OpName The name of the Web Service operation -> These names are unique + // WebService The name of the WebService this operation belongs to + // needs_SOAPAction Boolean indicating whether the operation needs to have the SOAPAction passed in the setRequestHeaderfunction. + // true if the operation does a write, else false + + var WSops = {}; + + WSops.GetAlerts = [webServices.ALERTS, false]; + WSops.DeleteAlerts = [webServices.ALERTS, true]; + + WSops.Mode = [webServices.AUTHENTICATION, false]; + WSops.Login = [webServices.AUTHENTICATION, false]; + + WSops.CopyIntoItems = [webServices.COPY, true]; + WSops.CopyIntoItemsLocal = [webServices.COPY, true]; + WSops.GetItem = [webServices.COPY, false]; + + WSops.GetForm = [webServices.FORMS, false]; + WSops.GetFormCollection = [webServices.FORMS, false]; + + WSops.AddAttachment = [webServices.LISTS, true]; + WSops.AddDiscussionBoardItem = [webServices.LISTS, true]; + WSops.AddList = [webServices.LISTS, true]; + WSops.AddListFromFeature = [webServices.LISTS, true]; + WSops.ApplyContentTypeToList = [webServices.LISTS, true]; + WSops.CheckInFile = [webServices.LISTS, true]; + WSops.CheckOutFile = [webServices.LISTS, true]; + WSops.CreateContentType = [webServices.LISTS, true]; + WSops.DeleteAttachment = [webServices.LISTS, true]; + WSops.DeleteContentType = [webServices.LISTS, true]; + WSops.DeleteContentTypeXmlDocument = [webServices.LISTS, true]; + WSops.DeleteList = [webServices.LISTS, true]; + WSops.GetAttachmentCollection = [webServices.LISTS, false]; + WSops.GetList = [webServices.LISTS, false]; + WSops.GetListAndView = [webServices.LISTS, false]; + WSops.GetListCollection = [webServices.LISTS, false]; + WSops.GetListContentType = [webServices.LISTS, false]; + WSops.GetListContentTypes = [webServices.LISTS, false]; + WSops.GetListItemChanges = [webServices.LISTS, false]; + WSops.GetListItemChangesSinceToken = [webServices.LISTS, false]; + WSops.GetListItems = [webServices.LISTS, false]; + WSops.GetVersionCollection = [webServices.LISTS, false]; + WSops.UndoCheckOut = [webServices.LISTS, true]; + WSops.UpdateContentType = [webServices.LISTS, true]; + WSops.UpdateContentTypesXmlDocument = [webServices.LISTS, true]; + WSops.UpdateContentTypeXmlDocument = [webServices.LISTS, true]; + WSops.UpdateList = [webServices.LISTS, true]; + WSops.UpdateListItems = [webServices.LISTS, true]; + + WSops.AddMeeting = [webServices.MEETINGS, true]; + WSops.CreateWorkspace = [webServices.MEETINGS, true]; + WSops.RemoveMeeting = [webServices.MEETINGS, true]; + WSops.SetWorkSpaceTitle = [webServices.MEETINGS, true]; + + WSops.GetRecordRouting = [webServices.OFFICIALFILE, false]; + WSops.GetRecordRoutingCollection = [webServices.OFFICIALFILE, false]; + WSops.GetServerInfo = [webServices.OFFICIALFILE, false]; + WSops.SubmitFile = [webServices.OFFICIALFILE, true]; + + WSops.ResolvePrincipals = [webServices.PEOPLE, true]; + WSops.SearchPrincipals = [webServices.PEOPLE, false]; + + WSops.AddPermission = [webServices.PERMISSIONS, true]; + WSops.AddPermissionCollection = [webServices.PERMISSIONS, true]; + WSops.GetPermissionCollection = [webServices.PERMISSIONS, true]; + WSops.RemovePermission = [webServices.PERMISSIONS, true]; + WSops.RemovePermissionCollection = [webServices.PERMISSIONS, true]; + WSops.UpdatePermission = [webServices.PERMISSIONS, true]; + + WSops.GetLinks = [webServices.PUBLISHEDLINKSSERVICE, true]; + + WSops.GetPortalSearchInfo = [webServices.SEARCH, false]; + WSops.GetQuerySuggestions = [webServices.SEARCH, false]; + WSops.GetSearchMetadata = [webServices.SEARCH, false]; + WSops.Query = [webServices.SEARCH, false]; + WSops.QueryEx = [webServices.SEARCH, false]; + WSops.Registration = [webServices.SEARCH, false]; + WSops.Status = [webServices.SEARCH, false]; + + WSops.SendClientScriptErrorReport = [webServices.SHAREPOINTDIAGNOSTICS, true]; + + WSops.GetAttachments = [webServices.SITEDATA, false]; + WSops.EnumerateFolder = [webServices.SITEDATA, false]; + WSops.SiteDataGetList = [webServices.SITEDATA, false]; + WSops.SiteDataGetListCollection = [webServices.SITEDATA, false]; + WSops.SiteDataGetSite = [webServices.SITEDATA, false]; + WSops.SiteDataGetSiteUrl = [webServices.SITEDATA, false]; + WSops.SiteDataGetWeb = [webServices.SITEDATA, false]; + + WSops.CreateWeb = [webServices.SITES, true]; + WSops.DeleteWeb = [webServices.SITES, true]; + WSops.GetSite = [webServices.SITES, false]; + WSops.GetSiteTemplates = [webServices.SITES, false]; + + WSops.AddComment = [webServices.SOCIALDATASERVICE, true]; + WSops.AddTag = [webServices.SOCIALDATASERVICE, true]; + WSops.AddTagByKeyword = [webServices.SOCIALDATASERVICE, true]; + WSops.CountCommentsOfUser = [webServices.SOCIALDATASERVICE, false]; + WSops.CountCommentsOfUserOnUrl = [webServices.SOCIALDATASERVICE, false]; + WSops.CountCommentsOnUrl = [webServices.SOCIALDATASERVICE, false]; + WSops.CountRatingsOnUrl = [webServices.SOCIALDATASERVICE, false]; + WSops.CountTagsOfUser = [webServices.SOCIALDATASERVICE, false]; + WSops.DeleteComment = [webServices.SOCIALDATASERVICE, true]; + WSops.DeleteRating = [webServices.SOCIALDATASERVICE, true]; + WSops.DeleteTag = [webServices.SOCIALDATASERVICE, true]; + WSops.DeleteTagByKeyword = [webServices.SOCIALDATASERVICE, true]; + WSops.DeleteTags = [webServices.SOCIALDATASERVICE, true]; + WSops.GetAllTagTerms = [webServices.SOCIALDATASERVICE, false]; + WSops.GetAllTagTermsForUrlFolder = [webServices.SOCIALDATASERVICE, false]; + WSops.GetAllTagUrls = [webServices.SOCIALDATASERVICE, false]; + WSops.GetAllTagUrlsByKeyword = [webServices.SOCIALDATASERVICE, false]; + WSops.GetCommentsOfUser = [webServices.SOCIALDATASERVICE, false]; + WSops.GetCommentsOfUserOnUrl = [webServices.SOCIALDATASERVICE, false]; + WSops.GetCommentsOnUrl = [webServices.SOCIALDATASERVICE, false]; + WSops.GetRatingAverageOnUrl = [webServices.SOCIALDATASERVICE, false]; + WSops.GetRatingOfUserOnUrl = [webServices.SOCIALDATASERVICE, false]; + WSops.GetRatingOnUrl = [webServices.SOCIALDATASERVICE, false]; + WSops.GetRatingsOfUser = [webServices.SOCIALDATASERVICE, false]; + WSops.GetRatingsOnUrl = [webServices.SOCIALDATASERVICE, false]; + WSops.GetSocialDataForFullReplication = [webServices.SOCIALDATASERVICE, false]; + WSops.GetTags = [webServices.SOCIALDATASERVICE, true]; + WSops.GetTagsOfUser = [webServices.SOCIALDATASERVICE, true]; + WSops.GetTagTerms = [webServices.SOCIALDATASERVICE, true]; + WSops.GetTagTermsOfUser = [webServices.SOCIALDATASERVICE, true]; + WSops.GetTagTermsOnUrl = [webServices.SOCIALDATASERVICE, true]; + WSops.GetTagUrlsOfUser = [webServices.SOCIALDATASERVICE, true]; + WSops.GetTagUrlsOfUserByKeyword = [webServices.SOCIALDATASERVICE, true]; + WSops.GetTagUrls = [webServices.SOCIALDATASERVICE, true]; + WSops.GetTagUrlsByKeyword = [webServices.SOCIALDATASERVICE, true]; + WSops.SetRating = [webServices.SOCIALDATASERVICE, true]; + WSops.UpdateComment = [webServices.SOCIALDATASERVICE, true]; + + WSops.SpellCheck = [webServices.SPELLCHECK, false]; + + // Taxonomy Service Calls + // Updated 2011.01.27 by Thomas McMillan + WSops.AddTerms = [webServices.TAXONOMYSERVICE, true]; + WSops.GetChildTermsInTerm = [webServices.TAXONOMYSERVICE, false]; + WSops.GetChildTermsInTermSet = [webServices.TAXONOMYSERVICE, false]; + WSops.GetKeywordTermsByGuids = [webServices.TAXONOMYSERVICE, false]; + WSops.GetTermsByLabel = [webServices.TAXONOMYSERVICE, false]; + WSops.GetTermSets = [webServices.TAXONOMYSERVICE, false]; + + WSops.AddGroup = [webServices.USERGROUP, true]; + WSops.AddGroupToRole = [webServices.USERGROUP, true]; + WSops.AddRole = [webServices.USERGROUP, true]; + WSops.AddRoleDef = [webServices.USERGROUP, true]; + WSops.AddUserCollectionToGroup = [webServices.USERGROUP, true]; + WSops.AddUserCollectionToRole = [webServices.USERGROUP, true]; + WSops.AddUserToGroup = [webServices.USERGROUP, true]; + WSops.AddUserToRole = [webServices.USERGROUP, true]; + WSops.GetAllUserCollectionFromWeb = [webServices.USERGROUP, false]; + WSops.GetGroupCollection = [webServices.USERGROUP, false]; + WSops.GetGroupCollectionFromRole = [webServices.USERGROUP, false]; + WSops.GetGroupCollectionFromSite = [webServices.USERGROUP, false]; + WSops.GetGroupCollectionFromUser = [webServices.USERGROUP, false]; + WSops.GetGroupCollectionFromWeb = [webServices.USERGROUP, false]; + WSops.GetGroupInfo = [webServices.USERGROUP, false]; + WSops.GetRoleCollection = [webServices.USERGROUP, false]; + WSops.GetRoleCollectionFromGroup = [webServices.USERGROUP, false]; + WSops.GetRoleCollectionFromUser = [webServices.USERGROUP, false]; + WSops.GetRoleCollectionFromWeb = [webServices.USERGROUP, false]; + WSops.GetRoleInfo = [webServices.USERGROUP, false]; + WSops.GetRolesAndPermissionsForCurrentUser = [webServices.USERGROUP, false]; + WSops.GetRolesAndPermissionsForSite = [webServices.USERGROUP, false]; + WSops.GetUserCollection = [webServices.USERGROUP, false]; + WSops.GetUserCollectionFromGroup = [webServices.USERGROUP, false]; + WSops.GetUserCollectionFromRole = [webServices.USERGROUP, false]; + WSops.GetUserCollectionFromSite = [webServices.USERGROUP, false]; + WSops.GetUserCollectionFromWeb = [webServices.USERGROUP, false]; + WSops.GetUserInfo = [webServices.USERGROUP, false]; + WSops.GetUserLoginFromEmail = [webServices.USERGROUP, false]; + WSops.RemoveGroup = [webServices.USERGROUP, true]; + WSops.RemoveGroupFromRole = [webServices.USERGROUP, true]; + WSops.RemoveRole = [webServices.USERGROUP, true]; + WSops.RemoveUserCollectionFromGroup = [webServices.USERGROUP, true]; + WSops.RemoveUserCollectionFromRole = [webServices.USERGROUP, true]; + WSops.RemoveUserCollectionFromSite = [webServices.USERGROUP, true]; + WSops.RemoveUserFromGroup = [webServices.USERGROUP, true]; + WSops.RemoveUserFromRole = [webServices.USERGROUP, true]; + WSops.RemoveUserFromSite = [webServices.USERGROUP, true]; + WSops.RemoveUserFromWeb = [webServices.USERGROUP, true]; + WSops.UpdateGroupInfo = [webServices.USERGROUP, true]; + WSops.UpdateRoleDefInfo = [webServices.USERGROUP, true]; + WSops.UpdateRoleInfo = [webServices.USERGROUP, true]; + WSops.UpdateUserInfo = [webServices.USERGROUP, true]; + + WSops.AddColleague = [webServices.USERPROFILESERVICE, true]; + WSops.AddLink = [webServices.USERPROFILESERVICE, true]; + WSops.AddMembership = [webServices.USERPROFILESERVICE, true]; + WSops.AddPinnedLink = [webServices.USERPROFILESERVICE, true]; + WSops.CreateMemberGroup = [webServices.USERPROFILESERVICE, true]; + WSops.CreateUserProfileByAccountName = [webServices.USERPROFILESERVICE, true]; + WSops.GetCommonColleagues = [webServices.USERPROFILESERVICE, false]; + WSops.GetCommonManager = [webServices.USERPROFILESERVICE, false]; + WSops.GetCommonMemberships = [webServices.USERPROFILESERVICE, false]; + WSops.GetInCommon = [webServices.USERPROFILESERVICE, false]; + WSops.GetPropertyChoiceList = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserColleagues = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserLinks = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserMemberships = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserPinnedLinks = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserProfileByGuid = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserProfileByIndex = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserProfileByName = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserProfileCount = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserProfileSchema = [webServices.USERPROFILESERVICE, false]; + WSops.GetUserPropertyByAccountName = [webServices.USERPROFILESERVICE, false]; + WSops.ModifyUserPropertyByAccountName = [webServices.USERPROFILESERVICE, true]; + WSops.RemoveAllColleagues = [webServices.USERPROFILESERVICE, true]; + WSops.RemoveAllLinks = [webServices.USERPROFILESERVICE, true]; + WSops.RemoveAllMemberships = [webServices.USERPROFILESERVICE, true]; + WSops.RemoveAllPinnedLinks = [webServices.USERPROFILESERVICE, true]; + WSops.RemoveColleague = [webServices.USERPROFILESERVICE, true]; + WSops.RemoveLink = [webServices.USERPROFILESERVICE, true]; + WSops.RemoveMembership = [webServices.USERPROFILESERVICE, true]; + WSops.RemovePinnedLink = [webServices.USERPROFILESERVICE, true]; + WSops.UpdateColleaguePrivacy = [webServices.USERPROFILESERVICE, true]; + WSops.UpdateLink = [webServices.USERPROFILESERVICE, true]; + WSops.UpdateMembershipPrivacy = [webServices.USERPROFILESERVICE, true]; + WSops.UpdatePinnedLink = [webServices.USERPROFILESERVICE, true]; + + WSops.DeleteAllVersions = [webServices.VERSIONS, true]; + WSops.DeleteVersion = [webServices.VERSIONS, true]; + WSops.GetVersions = [webServices.VERSIONS, false]; + WSops.RestoreVersion = [webServices.VERSIONS, true]; + + WSops.AddView = [webServices.VIEWS, true]; + WSops.DeleteView = [webServices.VIEWS, true]; + WSops.GetView = [webServices.VIEWS, false]; + WSops.GetViewHtml = [webServices.VIEWS, false]; + WSops.GetViewCollection = [webServices.VIEWS, false]; + WSops.UpdateView = [webServices.VIEWS, true]; + WSops.UpdateViewHtml = [webServices.VIEWS, true]; + + WSops.AddWebPart = [webServices.WEBPARTPAGES, true]; + WSops.AddWebPartToZone = [webServices.WEBPARTPAGES, true]; + WSops.DeleteWebPart = [webServices.WEBPARTPAGES, true]; + WSops.GetWebPart2 = [webServices.WEBPARTPAGES, false]; + WSops.GetWebPartPage = [webServices.WEBPARTPAGES, false]; + WSops.GetWebPartProperties = [webServices.WEBPARTPAGES, false]; + WSops.GetWebPartProperties2 = [webServices.WEBPARTPAGES, false]; + WSops.SaveWebPart2 = [webServices.WEBPARTPAGES, true]; + + WSops.WebsCreateContentType = [webServices.WEBS, true]; + WSops.GetColumns = [webServices.WEBS, false]; + WSops.GetContentType = [webServices.WEBS, false]; + WSops.GetContentTypes = [webServices.WEBS, false]; + WSops.GetCustomizedPageStatus = [webServices.WEBS, false]; + WSops.GetListTemplates = [webServices.WEBS, false]; + WSops.GetObjectIdFromUrl = [webServices.WEBS, false]; // 2010 + WSops.GetWeb = [webServices.WEBS, false]; + WSops.GetWebCollection = [webServices.WEBS, false]; + WSops.GetAllSubWebCollection = [webServices.WEBS, false]; + WSops.UpdateColumns = [webServices.WEBS, true]; + WSops.WebsUpdateContentType = [webServices.WEBS, true]; + WSops.WebUrlFromPageUrl = [webServices.WEBS, false]; + + WSops.AlterToDo = [webServices.WORKFLOW, true]; + WSops.ClaimReleaseTask = [webServices.WORKFLOW, true]; + WSops.GetTemplatesForItem = [webServices.WORKFLOW, false]; + WSops.GetToDosForItem = [webServices.WORKFLOW, false]; + WSops.GetWorkflowDataForItem = [webServices.WORKFLOW, false]; + WSops.GetWorkflowTaskData = [webServices.WORKFLOW, false]; + WSops.StartWorkflow = [webServices.WORKFLOW, true]; + + //Nintex + WSops.AddLongTermDelegationRule = [webServices.NINTEXWORKFLOW, true]; + WSops.AddWorkflowSchedule = [webServices.NINTEXWORKFLOW, true]; + WSops.AddWorkflowScheduleOnListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.CheckGlobalReuseStatus = [webServices.NINTEXWORKFLOW, true]; + WSops.CheckInForms = [webServices.NINTEXWORKFLOW, true]; + WSops.DelegateAllTasks = [webServices.NINTEXWORKFLOW, true]; + WSops.DelegateTask = [webServices.NINTEXWORKFLOW, true]; + WSops.DeleteLongTermDelegationRule = [webServices.NINTEXWORKFLOW, true]; + WSops.DeleteSnippet = [webServices.NINTEXWORKFLOW, true]; + WSops.DeleteWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.ExportWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.FixWorkflowsInSiteFromTemplate = [webServices.NINTEXWORKFLOW, true]; + WSops.GetFolders = [webServices.NINTEXWORKFLOW, true]; + WSops.GetItemsPendingMyApproval = [webServices.NINTEXWORKFLOW, true]; + WSops.GetListContentTypes = [webServices.NINTEXWORKFLOW, true]; + WSops.GetOutcomesForFlexiTask = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasks = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasksCollection = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasksForCurrentUser = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasksForCurrentUserForListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasksForListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.GetTaskDetailsUsingStub = [webServices.NINTEXWORKFLOW, true]; + WSops.GetTaskStubsForCurrentUser = [webServices.NINTEXWORKFLOW, true]; + WSops.GetWorkflowHistory = [webServices.NINTEXWORKFLOW, true]; + WSops.GetWorkflowHistoryForListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.HideTaskForApprover = [webServices.NINTEXWORKFLOW, true]; + WSops.HideWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessFlexiTaskResponse = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessFlexiTaskResponse2 = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessTaskResponse = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessTaskResponse2 = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessTaskResponse3 = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessTaskResponseUsingToken = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWF = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFSkipValidation = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFSkipValidationNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFXml = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFXmlNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFXmlSkipValidation = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFXmlSkipValidationNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.QueryForMessages = [webServices.NINTEXWORKFLOW, true]; + WSops.RemoveWorkflowSchedule = [webServices.NINTEXWORKFLOW, true]; + WSops.RemoveWorkflowScheduleOnListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveFromNWF = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveFromNWFNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveFromNWFXml = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveFromNWFXmlNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveSnippet = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveTemplate = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveTemplate2 = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.SnippetExists = [webServices.NINTEXWORKFLOW, true]; + WSops.StartSiteWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.NintexStartWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.StartWorkflowOnListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.TemplateExists = [webServices.NINTEXWORKFLOW, true]; + WSops.TerminateWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.TerminateWorkflowByName = [webServices.NINTEXWORKFLOW, true]; + WSops.TerminateWorkflowByNameForListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.WorkflowExists = [webServices.NINTEXWORKFLOW, true]; + WSops.WorkflowFormProductSelected = [webServices.NINTEXWORKFLOW, true]; + + + // Main function, which calls SharePoint's Web Services directly. + $.fn.SPServices = function (options) { + + // If there are no options passed in, use the defaults. Extend replaces each default with the passed option. + var opt = $.extend({}, $.fn.SPServices.defaults, options); + + // Encode options which may contain special character, esp. ampersand + for (var i = 0; i < encodeOptionList.length; i++) { + if (typeof opt[encodeOptionList[i]] === "string") { + opt[encodeOptionList[i]] = utils.encodeXml(opt[encodeOptionList[i]]); + } + } + + // Put together operation header and SOAPAction for the SOAP call based on which Web Service we're calling + SOAPEnvelope.opheader = "<" + opt.operation + " "; + + + + switch (WSops[opt.operation][0]) { + case webServices.ALERTS: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/2002/1/alerts/' >"; + SOAPAction = constants.SCHEMASharePoint + "/soap/2002/1/alerts/"; + break; + case webServices.MEETINGS: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/meetings/' >"; + SOAPAction = constants.SCHEMASharePoint + "/soap/meetings/"; + break; + case webServices.OFFICIALFILE: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/recordsrepository/' >"; + SOAPAction = constants.SCHEMASharePoint + "/soap/recordsrepository/"; + break; + case webServices.PERMISSIONS: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/directory/' >"; + SOAPAction = constants.SCHEMASharePoint + "/soap/directory/"; + break; + case webServices.PUBLISHEDLINKSSERVICE: + SOAPEnvelope.opheader += "xmlns='http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService/' >"; + SOAPAction = "http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService/"; + break; + case webServices.SEARCH: + SOAPEnvelope.opheader += "xmlns='urn:Microsoft.Search' >"; + SOAPAction = "urn:Microsoft.Search/"; + break; + case webServices.SHAREPOINTDIAGNOSTICS: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/diagnostics/' >"; + SOAPAction = "http://schemas.microsoft.com/sharepoint/diagnostics/"; + break; + case webServices.SOCIALDATASERVICE: + SOAPEnvelope.opheader += "xmlns='http://microsoft.com/webservices/SharePointPortalServer/SocialDataService' >"; + SOAPAction = "http://microsoft.com/webservices/SharePointPortalServer/SocialDataService/"; + break; + case webServices.SPELLCHECK: + SOAPEnvelope.opheader += "xmlns='http://schemas.microsoft.com/sharepoint/publishing/spelling/' >"; + SOAPAction = "http://schemas.microsoft.com/sharepoint/publishing/spelling/SpellCheck"; + break; + case webServices.TAXONOMYSERVICE: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/taxonomy/soap/' >"; + SOAPAction = constants.SCHEMASharePoint + "/taxonomy/soap/"; + break; + case webServices.USERGROUP: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/directory/' >"; + SOAPAction = constants.SCHEMASharePoint + "/soap/directory/"; + break; + case webServices.USERPROFILESERVICE: + SOAPEnvelope.opheader += "xmlns='http://microsoft.com/webservices/SharePointPortalServer/UserProfileService' >"; + SOAPAction = "http://microsoft.com/webservices/SharePointPortalServer/UserProfileService/"; + break; + case webServices.WEBPARTPAGES: + SOAPEnvelope.opheader += "xmlns='http://microsoft.com/sharepoint/webpartpages' >"; + SOAPAction = "http://microsoft.com/sharepoint/webpartpages/"; + break; + case webServices.WORKFLOW: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/workflow/' >"; + SOAPAction = constants.SCHEMASharePoint + "/soap/workflow/"; + break; + default: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMASharePoint + "/soap/'>"; + SOAPAction = constants.SCHEMASharePoint + "/soap/"; + break; + } + + // Add the operation to the SOAPAction and opfooter + SOAPAction += opt.operation; + SOAPEnvelope.opfooter = ""; + + // Build the URL for the Ajax call based on which operation we're calling + // If the webURL has been provided, then use it, else use the current site + var ajaxURL = "_vti_bin/" + WSops[opt.operation][0] + ".asmx"; + var webURL = opt.webURL !== undefined ? opt.webURL : opt.webUrl; + if (webURL.charAt(webURL.length - 1) === constants.SLASH) { + ajaxURL = webURL + ajaxURL; + } else if (webURL.length > 0) { + ajaxURL = webURL + constants.SLASH + ajaxURL; + } else { + var thisSite = $().SPServices.SPGetCurrentSite(); + ajaxURL = thisSite + ((thisSite.charAt(thisSite.length - 1) === constants.SLASH) ? ajaxURL : (constants.SLASH + ajaxURL)); + } + + SOAPEnvelope.payload = ""; + // Each operation requires a different set of values. This switch statement sets them up in the SOAPEnvelope.payload. + switch (opt.operation) { + // ALERT OPERATIONS + case "GetAlerts": + break; + case "DeleteAlerts": + SOAPEnvelope.payload += ""; + for (i = 0; i < opt.IDs.length; i++) { + SOAPEnvelope.payload += constants.wrapNode("string", opt.IDs[i]); + } + SOAPEnvelope.payload += ""; + break; + + // AUTHENTICATION OPERATIONS + case "Mode": + break; + case "Login": + utils.addToPayload(opt, SOAPEnvelope, ["username", "password"]); + break; + + // COPY OPERATIONS + case "CopyIntoItems": + utils.addToPayload(opt, SOAPEnvelope, ["SourceUrl"]); + SOAPEnvelope.payload += ""; + for (i = 0; i < opt.DestinationUrls.length; i++) { + SOAPEnvelope.payload += utils.wrapNode("string", opt.DestinationUrls[i]); + } + SOAPEnvelope.payload += ""; + utils.addToPayload(opt, SOAPEnvelope, ["Fields", "Stream", "Results"]); + break; + case "CopyIntoItemsLocal": + utils.addToPayload(opt, SOAPEnvelope, ["SourceUrl"]); + SOAPEnvelope.payload += ""; + for (i = 0; i < opt.DestinationUrls.length; i++) { + SOAPEnvelope.payload += utils.wrapNode("string", opt.DestinationUrls[i]); + } + SOAPEnvelope.payload += ""; + break; + case "GetItem": + utils.addToPayload(opt, SOAPEnvelope, ["Url", "Fields", "Stream"]); + break; + + // FORM OPERATIONS + case "GetForm": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "formUrl"]); + break; + case "GetFormCollection": + utils.addToPayload(opt, SOAPEnvelope, ["listName"]); + break; + + // LIST OPERATIONS + case "AddAttachment": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "listItemID", "fileName", "attachment"]); + break; + case "AddDiscussionBoardItem": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "message"]); + break; + case "AddList": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "description", "templateID"]); + break; + case "AddListFromFeature": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "description", "featureID", "templateID"]); + break; + case "ApplyContentTypeToList": + utils.addToPayload(opt, SOAPEnvelope, ["webUrl", "contentTypeId", "listName"]); + break; + case "CheckInFile": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl", "comment", "CheckinType"]); + break; + case "CheckOutFile": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl", "checkoutToLocal", "lastmodified"]); + break; + case "CreateContentType": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "displayName", "parentType", "fields", "contentTypeProperties", "addToView"]); + break; + case "DeleteAttachment": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "listItemID", "url"]); + break; + case "DeleteContentType": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "contentTypeId"]); + break; + case "DeleteContentTypeXmlDocument": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "contentTypeId", "documentUri"]); + break; + case "DeleteList": + utils.addToPayload(opt, SOAPEnvelope, ["listName"]); + break; + case "GetAttachmentCollection": + utils.addToPayload(opt, SOAPEnvelope, ["listName", ["listItemID", "ID"]]); + break; + case "GetList": + utils.addToPayload(opt, SOAPEnvelope, ["listName"]); + break; + case "GetListAndView": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewName"]); + break; + case "GetListCollection": + break; + case "GetListContentType": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "contentTypeId"]); + break; + case "GetListContentTypes": + utils.addToPayload(opt, SOAPEnvelope, ["listName"]); + break; + case "GetListItems": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewName", ["query", "CAMLQuery"], + ["viewFields", "CAMLViewFields"], + ["rowLimit", "CAMLRowLimit"], + ["queryOptions", "CAMLQueryOptions"] + ]); + break; + case "GetListItemChanges": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewFields", "since", "contains"]); + break; + case "GetListItemChangesSinceToken": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewName", ["query", "CAMLQuery"], + ["viewFields", "CAMLViewFields"], + ["rowLimit", "CAMLRowLimit"], + ["queryOptions", "CAMLQueryOptions"], { + name: "changeToken", + sendNull: false + }, { + name: "contains", + sendNull: false + } + ]); + break; + case "GetVersionCollection": + utils.addToPayload(opt, SOAPEnvelope, ["strlistID", "strlistItemID", "strFieldName"]); + break; + case "UndoCheckOut": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl"]); + break; + case "UpdateContentType": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "contentTypeId", "contentTypeProperties", "newFields", "updateFields", "deleteFields", "addToView"]); + break; + case "UpdateContentTypesXmlDocument": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "newDocument"]); + break; + case "UpdateContentTypeXmlDocument": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "contentTypeId", "newDocument"]); + break; + case "UpdateList": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "listProperties", "newFields", "updateFields", "deleteFields", "listVersion"]); + break; + case "UpdateListItems": + utils.addToPayload(opt, SOAPEnvelope, ["listName"]); + if (typeof opt.updates !== "undefined" && opt.updates.length > 0) { + utils.addToPayload(opt, SOAPEnvelope, ["updates"]); + } else { + SOAPEnvelope.payload += ""; + for (i = 0; i < opt.valuepairs.length; i++) { + SOAPEnvelope.payload += "" + utils.escapeColumnValue(opt.valuepairs[i][1]) + ""; + } + if (opt.batchCmd !== "New") { + SOAPEnvelope.payload += "" + opt.ID + ""; + } + SOAPEnvelope.payload += ""; + } + break; + + // MEETINGS OPERATIONS + case "AddMeeting": + utils.addToPayload(opt, SOAPEnvelope, ["organizerEmail", "uid", "sequence", "utcDateStamp", "title", "location", "utcDateStart", "utcDateEnd", "nonGregorian"]); + break; + case "CreateWorkspace": + utils.addToPayload(opt, SOAPEnvelope, ["title", "templateName", "lcid", "timeZoneInformation"]); + break; + case "RemoveMeeting": + utils.addToPayload(opt, SOAPEnvelope, ["recurrenceId", "uid", "sequence", "utcDateStamp", "cancelMeeting"]); + break; + case "SetWorkspaceTitle": + utils.addToPayload(opt, SOAPEnvelope, ["title"]); + break; + + // OFFICIALFILE OPERATIONS + case "GetRecordRouting": + utils.addToPayload(opt, SOAPEnvelope, ["recordRouting"]); + break; + case "GetRecordRoutingCollection": + break; + case "GetServerInfo": + break; + case "SubmitFile": + utils.addToPayload(opt, SOAPEnvelope, ["fileToSubmit"], ["properties"], ["recordRouting"], ["sourceUrl"], ["userName"]); + break; + + + // PEOPLE OPERATIONS + case "ResolvePrincipals": + utils.addToPayload(opt, SOAPEnvelope, ["principalKeys", "principalType", "addToUserInfoList"]); + break; + case "SearchPrincipals": + utils.addToPayload(opt, SOAPEnvelope, ["searchText", "maxResults", "principalType"]); + break; + + // PERMISSION OPERATIONS + case "AddPermission": + utils.addToPayload(opt, SOAPEnvelope, ["objectName", "objectType", "permissionIdentifier", "permissionType", "permissionMask"]); + break; + case "AddPermissionCollection": + utils.addToPayload(opt, SOAPEnvelope, ["objectName", "objectType", "permissionsInfoXml"]); + break; + case "GetPermissionCollection": + utils.addToPayload(opt, SOAPEnvelope, ["objectName", "objectType"]); + break; + case "RemovePermission": + utils.addToPayload(opt, SOAPEnvelope, ["objectName", "objectType", "permissionIdentifier", "permissionType"]); + break; + case "RemovePermissionCollection": + utils.addToPayload(opt, SOAPEnvelope, ["objectName", "objectType", "memberIdsXml"]); + break; + case "UpdatePermission": + utils.addToPayload(opt, SOAPEnvelope, ["objectName", "objectType", "permissionIdentifier", "permissionType", "permissionMask"]); + break; + + // PUBLISHEDLINKSSERVICE OPERATIONS + case "GetLinks": + break; + + // SEARCH OPERATIONS + case "GetPortalSearchInfo": + SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>"; + SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation; + break; + case "GetQuerySuggestions": + SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>"; + SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation; + SOAPEnvelope.payload += utils.wrapNode("queryXml", constants.encodeXml(opt.queryXml)); + break; + case "GetSearchMetadata": + SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>"; + SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation; + break; + case "Query": + SOAPEnvelope.payload += utils.wrapNode("queryXml", constants.encodeXml(opt.queryXml)); + break; + case "QueryEx": + SOAPEnvelope.opheader = "<" + opt.operation + " xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>"; + SOAPAction = "http://microsoft.com/webservices/OfficeServer/QueryService/" + opt.operation; + SOAPEnvelope.payload += utils.wrapNode("queryXml", constants.encodeXml(opt.queryXml)); + break; + case "Registration": + SOAPEnvelope.payload += utils.wrapNode("registrationXml", constants.encodeXml(opt.registrationXml)); + break; + case "Status": + break; + + // SHAREPOINTDIAGNOSTICS OPERATIONS + case "SendClientScriptErrorReport": + utils.addToPayload(opt, SOAPEnvelope, ["message", "file", "line", "client", "stack", "team", "originalFile"]); + break; + + // SITEDATA OPERATIONS + case "EnumerateFolder": + utils.addToPayload(opt, SOAPEnvelope, ["strFolderUrl"]); + break; + case "GetAttachments": + utils.addToPayload(opt, SOAPEnvelope, ["strListName", "strItemId"]); + break; + case "SiteDataGetList": + utils.addToPayload(opt, SOAPEnvelope, ["strListName"]); + // Because this operation has a name which duplicates the Lists WS, need to handle + SOAPEnvelope = constants.siteDataFixSOAPEnvelope(SOAPEnvelope, opt.operation); + break; + case "SiteDataGetListCollection": + // Because this operation has a name which duplicates the Lists WS, need to handle + SOAPEnvelope = constants.siteDataFixSOAPEnvelope(SOAPEnvelope, opt.operation); + break; + case "SiteDataGetSite": + // Because this operation has a name which duplicates the Lists WS, need to handle + SOAPEnvelope = constants.siteDataFixSOAPEnvelope(SOAPEnvelope, opt.operation); + break; + case "SiteDataGetSiteUrl": + utils.addToPayload(opt, SOAPEnvelope, ["Url"]); + // Because this operation has a name which duplicates the Lists WS, need to handle + SOAPEnvelope = constants.siteDataFixSOAPEnvelope(SOAPEnvelope, opt.operation); + break; + case "SiteDataGetWeb": + // Because this operation has a name which duplicates the Lists WS, need to handle + SOAPEnvelope = constants.siteDataFixSOAPEnvelope(SOAPEnvelope, opt.operation); + break; + + // SITES OPERATIONS + case "CreateWeb": + utils.addToPayload(opt, SOAPEnvelope, ["url", "title", "description", "templateName", "language", "languageSpecified", + "locale", "localeSpecified", "collationLocale", "collationLocaleSpecified", "uniquePermissions", + "uniquePermissionsSpecified", "anonymous", "anonymousSpecified", "presence", "presenceSpecified" + ]); + break; + case "DeleteWeb": + utils.addToPayload(opt, SOAPEnvelope, ["url"]); + break; + case "GetSite": + utils.addToPayload(opt, SOAPEnvelope, ["SiteUrl"]); + break; + case "GetSiteTemplates": + utils.addToPayload(opt, SOAPEnvelope, ["LCID", "TemplateList"]); + break; + + // SOCIALDATASERVICE OPERATIONS + case "AddComment": + utils.addToPayload(opt, SOAPEnvelope, ["url", "comment", "isHighPriority", "title"]); + break; + case "AddTag": + utils.addToPayload(opt, SOAPEnvelope, ["url", "termID", "title", "isPrivate"]); + break; + case "AddTagByKeyword": + utils.addToPayload(opt, SOAPEnvelope, ["url", "keyword", "title", "isPrivate"]); + break; + case "CountCommentsOfUser": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName"]); + break; + case "CountCommentsOfUserOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName", "url"]); + break; + case "CountCommentsOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["url"]); + break; + case "CountRatingsOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["url"]); + break; + case "CountTagsOfUser": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName"]); + break; + case "DeleteComment": + utils.addToPayload(opt, SOAPEnvelope, ["url", "lastModifiedTime"]); + break; + case "DeleteRating": + utils.addToPayload(opt, SOAPEnvelope, ["url"]); + break; + case "DeleteTag": + utils.addToPayload(opt, SOAPEnvelope, ["url", "termID"]); + break; + case "DeleteTagByKeyword": + utils.addToPayload(opt, SOAPEnvelope, ["url", "keyword"]); + break; + case "DeleteTags": + utils.addToPayload(opt, SOAPEnvelope, ["url"]); + break; + case "GetAllTagTerms": + utils.addToPayload(opt, SOAPEnvelope, ["maximumItemsToReturn"]); + break; + case "GetAllTagTermsForUrlFolder": + utils.addToPayload(opt, SOAPEnvelope, ["urlFolder", "maximumItemsToReturn"]); + break; + case "GetAllTagUrls": + utils.addToPayload(opt, SOAPEnvelope, ["termID"]); + break; + case "GetAllTagUrlsByKeyword": + utils.addToPayload(opt, SOAPEnvelope, ["keyword"]); + break; + case "GetCommentsOfUser": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName", "maximumItemsToReturn", "startIndex"]); + break; + case "GetCommentsOfUserOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName", "url"]); + break; + case "GetCommentsOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["url", "maximumItemsToReturn", "startIndex"]); + if (typeof opt.excludeItemsTime !== "undefined" && opt.excludeItemsTime.length > 0) { + SOAPEnvelope.payload += utils.wrapNode("excludeItemsTime", opt.excludeItemsTime); + } + break; + case "GetRatingAverageOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["url"]); + break; + case "GetRatingOfUserOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName", "url"]); + break; + case "GetRatingOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["url"]); + break; + case "GetRatingsOfUser": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName"]); + break; + case "GetRatingsOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["url"]); + break; + case "GetSocialDataForFullReplication": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName"]); + break; + case "GetTags": + utils.addToPayload(opt, SOAPEnvelope, ["url"]); + break; + case "GetTagsOfUser": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName", "maximumItemsToReturn", "startIndex"]); + break; + case "GetTagTerms": + utils.addToPayload(opt, SOAPEnvelope, ["maximumItemsToReturn"]); + break; + case "GetTagTermsOfUser": + utils.addToPayload(opt, SOAPEnvelope, ["userAccountName", "maximumItemsToReturn"]); + break; + case "GetTagTermsOnUrl": + utils.addToPayload(opt, SOAPEnvelope, ["url", "maximumItemsToReturn"]); + break; + case "GetTagUrls": + utils.addToPayload(opt, SOAPEnvelope, ["termID"]); + break; + case "GetTagUrlsByKeyword": + utils.addToPayload(opt, SOAPEnvelope, ["keyword"]); + break; + case "GetTagUrlsOfUser": + utils.addToPayload(opt, SOAPEnvelope, ["termID", "userAccountName"]); + break; + case "GetTagUrlsOfUserByKeyword": + utils.addToPayload(opt, SOAPEnvelope, ["keyword", "userAccountName"]); + break; + case "SetRating": + utils.addToPayload(opt, SOAPEnvelope, ["url", "rating", "title", "analysisDataEntry"]); + break; + case "UpdateComment": + utils.addToPayload(opt, SOAPEnvelope, ["url", "lastModifiedTime", "comment", "isHighPriority"]); + break; + + // SPELLCHECK OPERATIONS + case "SpellCheck": + utils.addToPayload(opt, SOAPEnvelope, ["chunksToSpell", "declaredLanguage", "useLad"]); + break; + + // TAXONOMY OPERATIONS + case "AddTerms": + utils.addToPayload(opt, SOAPEnvelope, ["sharedServiceId", "termSetId", "lcid", "newTerms"]); + break; + case "GetChildTermsInTerm": + utils.addToPayload(opt, SOAPEnvelope, ["sspId", "lcid", "termId", "termSetId"]); + break; + case "GetChildTermsInTermSet": + utils.addToPayload(opt, SOAPEnvelope, ["sspId", "lcid", "termSetId"]); + break; + case "GetKeywordTermsByGuids": + utils.addToPayload(opt, SOAPEnvelope, ["termIds", "lcid"]); + break; + case "GetTermsByLabel": + utils.addToPayload(opt, SOAPEnvelope, ["label", "lcid", "matchOption", "resultCollectionSize", "termIds", "addIfNotFound"]); + break; + case "GetTermSets": + utils.addToPayload(opt, SOAPEnvelope, ["sharedServiceIds", "termSetIds", "lcid", "clientTimeStamps", "clientVersions"]); + break; + + // USERS AND GROUPS OPERATIONS + case "AddGroup": + utils.addToPayload(opt, SOAPEnvelope, ["groupName", "ownerIdentifier", "ownerType", "defaultUserLoginName", "description"]); + break; + case "AddGroupToRole": + utils.addToPayload(opt, SOAPEnvelope, ["groupName", "roleName"]); + break; + case "AddRole": + utils.addToPayload(opt, SOAPEnvelope, ["roleName", "description", "permissionMask"]); + break; + case "AddRoleDef": + utils.addToPayload(opt, SOAPEnvelope, ["roleName", "description", "permissionMask"]); + break; + case "AddUserCollectionToGroup": + utils.addToPayload(opt, SOAPEnvelope, ["groupName", "usersInfoXml"]); + break; + case "AddUserCollectionToRole": + utils.addToPayload(opt, SOAPEnvelope, ["roleName", "usersInfoXml"]); + break; + case "AddUserToGroup": + utils.addToPayload(opt, SOAPEnvelope, ["groupName", "userName", "userLoginName", "userEmail", "userNotes"]); + break; + case "AddUserToRole": + utils.addToPayload(opt, SOAPEnvelope, ["roleName", "userName", "userLoginName", "userEmail", "userNotes"]); + break; + case "GetAllUserCollectionFromWeb": + break; + case "GetGroupCollection": + utils.addToPayload(opt, SOAPEnvelope, ["groupNamesXml"]); + break; + case "GetGroupCollectionFromRole": + utils.addToPayload(opt, SOAPEnvelope, ["roleName"]); + break; + case "GetGroupCollectionFromSite": + break; + case "GetGroupCollectionFromUser": + utils.addToPayload(opt, SOAPEnvelope, ["userLoginName"]); + break; + case "GetGroupCollectionFromWeb": + break; + case "GetGroupInfo": + utils.addToPayload(opt, SOAPEnvelope, ["groupName"]); + break; + case "GetRoleCollection": + utils.addToPayload(opt, SOAPEnvelope, ["roleNamesXml"]); + break; + case "GetRoleCollectionFromGroup": + utils.addToPayload(opt, SOAPEnvelope, ["groupName"]); + break; + case "GetRoleCollectionFromUser": + utils.addToPayload(opt, SOAPEnvelope, ["userLoginName"]); + break; + case "GetRoleCollectionFromWeb": + break; + case "GetRoleInfo": + utils.addToPayload(opt, SOAPEnvelope, ["roleName"]); + break; + case "GetRolesAndPermissionsForCurrentUser": + break; + case "GetRolesAndPermissionsForSite": + break; + case "GetUserCollection": + utils.addToPayload(opt, SOAPEnvelope, ["userLoginNamesXml"]); + break; + case "GetUserCollectionFromGroup": + utils.addToPayload(opt, SOAPEnvelope, ["groupName"]); + break; + case "GetUserCollectionFromRole": + utils.addToPayload(opt, SOAPEnvelope, ["roleName"]); + break; + case "GetUserCollectionFromSite": + break; + case "GetUserCollectionFromWeb": + break; + case "GetUserInfo": + utils.addToPayload(opt, SOAPEnvelope, ["userLoginName"]); + break; + case "GetUserLoginFromEmail": + utils.addToPayload(opt, SOAPEnvelope, ["emailXml"]); + break; + case "RemoveGroup": + utils.addToPayload(opt, SOAPEnvelope, ["groupName"]); + break; + case "RemoveGroupFromRole": + utils.addToPayload(opt, SOAPEnvelope, ["roleName", "groupName"]); + break; + case "RemoveRole": + utils.addToPayload(opt, SOAPEnvelope, ["roleName"]); + break; + case "RemoveUserCollectionFromGroup": + utils.addToPayload(opt, SOAPEnvelope, ["groupName", "userLoginNamesXml"]); + break; + case "RemoveUserCollectionFromRole": + utils.addToPayload(opt, SOAPEnvelope, ["roleName", "userLoginNamesXml"]); + break; + case "RemoveUserCollectionFromSite": + utils.addToPayload(opt, SOAPEnvelope, ["userLoginNamesXml"]); + break; + case "RemoveUserFromGroup": + utils.addToPayload(opt, SOAPEnvelope, ["groupName", "userLoginName"]); + break; + case "RemoveUserFromRole": + utils.addToPayload(opt, SOAPEnvelope, ["roleName", "userLoginName"]); + break; + case "RemoveUserFromSite": + utils.addToPayload(opt, SOAPEnvelope, ["userLoginName"]); + break; + case "RemoveUserFromWeb": + utils.addToPayload(opt, SOAPEnvelope, ["userLoginName"]); + break; + case "UpdateGroupInfo": + utils.addToPayload(opt, SOAPEnvelope, ["oldGroupName", "groupName", "ownerIdentifier", "ownerType", "description"]); + break; + case "UpdateRoleDefInfo": + utils.addToPayload(opt, SOAPEnvelope, ["oldRoleName", "roleName", "description", "permissionMask"]); + break; + case "UpdateRoleInfo": + utils.addToPayload(opt, SOAPEnvelope, ["oldRoleName", "roleName", "description", "permissionMask"]); + break; + case "UpdateUserInfo": + utils.addToPayload(opt, SOAPEnvelope, ["userLoginName", "userName", "userEmail", "userNotes"]); + break; + + // USERPROFILESERVICE OPERATIONS + case "AddColleague": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "colleagueAccountName", "group", "privacy", "isInWorkGroup"]); + break; + case "AddLink": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "name", "url", "group", "privacy"]); + break; + case "AddMembership": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "membershipInfo", "group", "privacy"]); + break; + case "AddPinnedLink": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "name", "url"]); + break; + case "CreateMemberGroup": + utils.addToPayload(opt, SOAPEnvelope, ["membershipInfo"]); + break; + case "CreateUserProfileByAccountName": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "GetCommonColleagues": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "GetCommonManager": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "GetCommonMemberships": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "GetInCommon": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "GetPropertyChoiceList": + utils.addToPayload(opt, SOAPEnvelope, ["propertyName"]); + break; + case "GetUserColleagues": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "GetUserLinks": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "GetUserMemberships": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "GetUserPinnedLinks": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "GetUserProfileByGuid": + utils.addToPayload(opt, SOAPEnvelope, ["guid"]); + break; + case "GetUserProfileByIndex": + utils.addToPayload(opt, SOAPEnvelope, ["index"]); + break; + case "GetUserProfileByName": + // Note that this operation is inconsistent with the others, using AccountName rather than accountName + if (typeof opt.accountName !== "undefined" && opt.accountName.length > 0) { + utils.addToPayload(opt, SOAPEnvelope, [ + ["AccountName", "accountName"] + ]); + } else { + utils.addToPayload(opt, SOAPEnvelope, ["AccountName"]); + } + break; + case "GetUserProfileCount": + break; + case "GetUserProfileSchema": + break; + case "GetUserPropertyByAccountName": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "propertyName"]); + break; + case "ModifyUserPropertyByAccountName": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "newData"]); + break; + case "RemoveAllColleagues": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "RemoveAllLinks": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "RemoveAllMemberships": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "RemoveAllPinnedLinks": + utils.addToPayload(opt, SOAPEnvelope, ["accountName"]); + break; + case "RemoveColleague": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "colleagueAccountName"]); + break; + case "RemoveLink": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "id"]); + break; + case "RemoveMembership": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "sourceInternal", "sourceReference"]); + break; + case "RemovePinnedLink": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "id"]); + break; + case "UpdateColleaguePrivacy": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "colleagueAccountName", "newPrivacy"]); + break; + case "UpdateLink": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "data"]); + break; + case "UpdateMembershipPrivacy": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "sourceInternal", "sourceReference", "newPrivacy"]); + break; + case "UpdatePinnedLink ": + utils.addToPayload(opt, SOAPEnvelope, ["accountName", "data"]); + break; + + // VERSIONS OPERATIONS + case "DeleteAllVersions": + utils.addToPayload(opt, SOAPEnvelope, ["fileName"]); + break; + case "DeleteVersion": + utils.addToPayload(opt, SOAPEnvelope, ["fileName", "fileVersion"]); + break; + case "GetVersions": + utils.addToPayload(opt, SOAPEnvelope, ["fileName"]); + break; + case "RestoreVersion": + utils.addToPayload(opt, SOAPEnvelope, ["fileName", "fileVersion"]); + break; + + // VIEW OPERATIONS + case "AddView": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewName", "viewFields", "query", "rowLimit", "type", "makeViewDefault"]); + break; + case "DeleteView": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewName"]); + break; + case "GetView": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewName"]); + break; + case "GetViewCollection": + utils.addToPayload(opt, SOAPEnvelope, ["listName"]); + break; + case "GetViewHtml": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewName"]); + break; + case "UpdateView": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewName", "viewProperties", "query", "viewFields", "aggregations", "formats", "rowLimit"]); + break; + case "UpdateViewHtml": + utils.addToPayload(opt, SOAPEnvelope, ["listName", "viewName", "viewProperties", "toolbar", "viewHeader", "viewBody", "viewFooter", "viewEmpty", "rowLimitExceeded", + "query", "viewFields", "aggregations", "formats", "rowLimit" + ]); + break; + + // WEBPARTPAGES OPERATIONS + case "AddWebPart": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl", "webPartXml", "storage"]); + break; + case "AddWebPartToZone": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl", "webPartXml", "storage", "zoneId", "zoneIndex"]); + break; + case "DeleteWebPart": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl", "storageKey", "storage"]); + break; + case "GetWebPart2": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl", "storageKey", "storage", "behavior"]); + break; + case "GetWebPartPage": + utils.addToPayload(opt, SOAPEnvelope, ["documentName", "behavior"]); + break; + case "GetWebPartProperties": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl", "storage"]); + break; + case "GetWebPartProperties2": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl", "storage", "behavior"]); + break; + case "SaveWebPart2": + utils.addToPayload(opt, SOAPEnvelope, ["pageUrl", "storageKey", "webPartXml", "storage", "allowTypeChange"]); + break; + + // WEBS OPERATIONS + case "WebsCreateContentType": + utils.addToPayload(opt, SOAPEnvelope, ["displayName", "parentType", "newFields", "contentTypeProperties"]); + break; + case "GetColumns": + utils.addToPayload(opt, SOAPEnvelope, ["webUrl"]); + break; + case "GetContentType": + utils.addToPayload(opt, SOAPEnvelope, ["contentTypeId"]); + break; + case "GetContentTypes": + break; + case "GetCustomizedPageStatus": + utils.addToPayload(opt, SOAPEnvelope, ["fileUrl"]); + break; + case "GetListTemplates": + break; + case "GetObjectIdFromUrl": + utils.addToPayload(opt, SOAPEnvelope, ["objectUrl"]); + break; + case "GetWeb": + utils.addToPayload(opt, SOAPEnvelope, [ + ["webUrl", "webURL"] + ]); + break; + case "GetWebCollection": + break; + case "GetAllSubWebCollection": + break; + case "UpdateColumns": + utils.addToPayload(opt, SOAPEnvelope, ["newFields", "updateFields", "deleteFields"]); + break; + case "WebsUpdateContentType": + utils.addToPayload(opt, SOAPEnvelope, ["contentTypeId", "contentTypeProperties", "newFields", "updateFields", "deleteFields"]); + break; + case "WebUrlFromPageUrl": + utils.addToPayload(opt, SOAPEnvelope, [ + ["pageUrl", "pageURL"] + ]); + break; + + // WORKFLOW OPERATIONS + case "AlterToDo": + utils.addToPayload(opt, SOAPEnvelope, ["item", "todoId", "todoListId", "taskData"]); + break; + case "ClaimReleaseTask": + utils.addToPayload(opt, SOAPEnvelope, ["item", "taskId", "listId", "fClaim"]); + break; + case "GetTemplatesForItem": + utils.addToPayload(opt, SOAPEnvelope, ["item"]); + break; + case "GetToDosForItem": + utils.addToPayload(opt, SOAPEnvelope, ["item"]); + break; + case "GetWorkflowDataForItem": + utils.addToPayload(opt, SOAPEnvelope, ["item"]); + break; + case "GetWorkflowTaskData": + utils.addToPayload(opt, SOAPEnvelope, ["item", "listId", "taskId"]); + break; + case "StartWorkflow": + utils.addToPayload(opt, SOAPEnvelope, ["item", "templateId", "workflowParameters"]); + break; + + default: + break; + } + + // Glue together the pieces of the SOAP message + var msg = SOAPEnvelope.header + SOAPEnvelope.opheader + SOAPEnvelope.payload + SOAPEnvelope.opfooter + SOAPEnvelope.footer; + + // Check to see if we've already cached the results + var cachedPromise; + if (opt.cacheXML) { + cachedPromise = promisesCache[msg]; + } + + // Do we have any customHeaders? + var headers = opt.customHeaders ? opt.customHeaders : {}; + + if (typeof cachedPromise === "undefined") { + + // Finally, make the Ajax call + var p = $.ajax({ + // The relative URL for the AJAX call + url: ajaxURL, + // By default, the AJAX calls are asynchronous. You can specify false to require a synchronous call. + async: opt.async, + // Optionally, pass in headers + headers: headers, + // Before sending the msg, need to send the request header + beforeSend: function (xhr) { + // If we need to pass the SOAPAction, do so + if (WSops[opt.operation][1]) { + xhr.setRequestHeader("SOAPAction", SOAPAction); + } + }, + // Always a POST + type: "POST", + // Here is the SOAP request we've built above + data: msg, + // We're getting XML; tell jQuery so that it doesn't need to do a best guess + dataType: "xml", + // and this is its content type + contentType: "text/xml;charset='utf-8'", + complete: function (xData, Status) { + // When the call is complete, call the completefunc if there is one + if ($.isFunction(opt.completefunc)) { + opt.completefunc(xData, Status); + + } + } + }); + if(opt.cacheXML) { + promisesCache[msg] = p; + } + + // Return the promise + return p; + + } else { + + // Call the completefunc if there is one + if ($.isFunction(opt.completefunc)) { + cachedPromise.done(function(data, status, jqXHR){ + opt.completefunc(jqXHR, status); + }); + } + // Return the cached promise + return cachedPromise; + } + + }; // End $.fn.SPServices + + //Main function which calls Nintex's Web Services directly + $.fn.NintexServices = function (options) + { + // If there are no options passed in, use the defaults. Extend replaces each default with the passed option. + var opt = $.extend({}, $.fn.SPServices.defaults, options); + + // Encode options which may contain special character, esp. ampersand + for (var i = 0; i < encodeOptionList.length; i++) { + if (typeof opt[encodeOptionList[i]] === "string") { + opt[encodeOptionList[i]] = utils.encodeXml(opt[encodeOptionList[i]]); + } + }//end for + + // Put together operation header and SOAPAction for the SOAP call based on which Web Service we're calling + SOAPEnvelope.opheader = "<" + opt.operation + " "; + switch (WSops[opt.operation][0]) { + case webServices.NINTEXWORKFLOW: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMANintex + "'>"; + SOAPAction = constants.SCHEMANintex + "/"; + break; + default: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMANintex + "/soap/'>"; + SOAPAction = constants.SCHEMANintex + "/soap/"; + break; + }//end switch + + // Add the operation to the SOAPAction and opfooter + SOAPAction += opt.operation; + SOAPEnvelope.opfooter = ""; + + // Build the URL for the Ajax call based on which operation we're calling + // If the webURL has been provided, then use it, else use the current site + var ajaxURL = "_vti_bin/" + WSops[opt.operation][0] + ".asmx"; + var thisSite = $().SPServices.SPGetCurrentSite(); + var webURL = opt.webURL !== undefined ? opt.webURL : opt.webUrl; + if (webURL.charAt(webURL.length - 1) === constants.SLASH) { + ajaxURL = webURL + ajaxURL; + } else if (webURL.length > 0) { + ajaxURL = webURL + constants.SLASH + ajaxURL; + } else { + ajaxURL = thisSite + ((thisSite.charAt(thisSite.length - 1) === constants.SLASH) ? ajaxURL : (constants.SLASH + ajaxURL)); + } + + SOAPEnvelope.payload = ""; + // Each operation requires a different set of values. This switch statement sets them up in the SOAPEnvelope.payload. + switch (opt.operation) { + //NINTEX WORKFLOW OPERATIONS + case "AddLongTermDelegationRule": + utils.addToPayload(opt,["fromTheBeginningOf","untilTheEndOf","delegateFrom","delegateTo","currentSiteOnly"]); + break; + case "AddWorkflowSchedule": + utils.addToPayload(opt,["fileUrl","workflowName","startDataXml"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["MaximumRepeats","WorkdaysOnly"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["Type","CountBetweenIntervals"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["EndOn","StartTime","EndTime"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["updateIfExists"]); + break; + case "AddWorkflowScheduleOnListItem": + utils.addToPayload(opt,["itemId","listName","workflowName","startDataXML"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["MaximumRepeats","WorkdaysOnly"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["Type","CountBetweenIntervals"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["EndOn","StartTime","EndTime"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["updateIfExists"]); + break; + case "CheckGlobalReuseStatus": + utils.addToPayload(opt,["workflowName"]); + break; + case "CheckInForms": + utils.addToPayload(opt,["workflowConfiguration","activityConfiguration","formType"]); + break; + case "DelegateAllTasks": + utils.addToPayload(opt,["currentUser","newUser","sendNotification","comments","global"]); + break; + case "DelegateTask": + utils.addToPayload(opt,["spTaskId","taskListName","targetUserName","comments","sendNotification"]); + break; + case "DeleteLongTermDelegationRule": + utils.addToPayload(opt,["id"]); + break; + case "DeleteSnippet": + utils.addToPayload(opt,["snippetId"]); + break; + case "DeleteWorkflow": + utils.addToPayload(opt,["listId","workflowId","workflowType"]); + break; + case "ExportWorkflow": + utils.addToPayload(opt,["listName","workflowType","workflowName"]); + break; + case "FixWorkflowsInSiteFromTemplate": + utils.addToPayload(opt,["FixWorkflowsInSiteFromTemplate"]); + break; + case "GetFolders": + utils.addToPayload(opt,["listGuid"]); + break; + case "GetItemsPendingMyApproval": + utils.addToPayload(opt,["uniquenessInfo"]); + break; + case "GetListContentTypes": + utils.addToPayload(opt,["listGuid"]); + break; + case "GetOutcomesForFlexiTask": + utils.addToPayload(opt,["spTaskId","taskListName"]); + break; + case "GetRunningWorkflowTasks": + utils.addToPayload(opt,["fileUrl"]); + break; + case "GetRunningWorkflowTasksCollection": + utils.addToPayload(opt,["userlogin","teamsiteUrl","listName"]); + break; + case "GetRunningWorkflowTasksForCurrentUser": + utils.addToPayload(opt,["fileUrl"]); + break; + case "GetRunningWorkflowTasksForCurrentUserForListItem": + utils.addToPayload(opt,["itemId","listName"]); + break; + case "GetRunningWorkflowTasksForListItem": + utils.addToPayload(opt,["itemId","listName"]); + break; + case "GetTaskDetailsUsingStub": + utils.addToPayload(opt,["taskToken"]); + break; + case "GetTaskStubsForCurrentUser": + break; + case "GetWorkflowHistory": + utils.addToPayload(opt,["fileUrl","stateFilter","workflowNameFilter"]); + break; + case "GetWorkflowHistoryForListItem": + utils.addToPayload(opt,["itemId","listName","stateFilter","workflowNameFilter"]); + break; + case "HideTaskForApprover": + utils.addToPayload(opt,["approverId","contentDbId"]); + break; + case "HideWorkflow": + utils.addToPayload(opt,["siteId","instanceId"]); + break; + case "ProcessFlexiTaskResponse": + utils.addToPayload(opt,["comments","outcome","spTaskId","taskListName"]); + break; + case "ProcessFlexiTaskResponse2": + utils.addToPayload(opt,["comments","outcome","spTaskId","taskListName"]); + break; + case "ProcessTaskResponse": + utils.addToPayload(opt,["comments","outcome","spTaskId"]); + break; + case "ProcessTaskResponse2": + utils.addToPayload(opt,["comments","outcome","spTaskId","taskListName"]); + break; + case "ProcessTaskResponse3": + utils.addToPayload(opt,["comments","outcome","spTaskId","taskListName"]); + break; + case "ProcessTaskResponseUsingToken": + utils.addToPayload(opt,["comments","outcome","taskToken","customOutcome"]); + break; + case "PublishFromNWF": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFSkipValidation": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFSkipValidationNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFXml": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFXmlNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFXmlSkipValidation": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFXmlSkipValidationNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishWorkflow": + utils.addToPayload(opt,["wfName","activityConfigs","listId","contentTypeId","changeNotes"]); + break; + case "QueryForMessages": + utils.addToPayload(opt,["workflowInstanceId","messageId"]); + break; + case "RemoveWorkflowSchedule": + utils.addToPayload(opt,["fileUrl","workflowName"]); + break; + case "RemoveWorkflowScheduleOnListItem": + utils.addToPayload(opt,["itemId","listName","workflowName"]); + break; + case "SaveFromNWF": + utils.addToPayload(opt,["workflowFile","listName","workflowName"]); + break; + case "SaveFromNWFNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName"]); + break; + case "SaveFromNWFXml": + utils.addToPayload(opt,["workflowFile","listName","workflowName"]); + break; + case "SaveFromNWFXmlNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName"]); + break; + case "SaveSnippet": + utils.addToPayload(opt,["snippetName","activityConfigs"]); + break; + case "SaveTemplate": + utils.addToPayload(opt,["templateName","templateDescription","category","activityConfigs"]); + break; + case "SaveTemplate2": + utils.addToPayload(opt,["templateName","templateDescription","category","activityConfigs","lcid"]); + break; + case "SaveWorkflow": + utils.addToPayload(opt,["wfName","activityConfigs","listId","contentTypeId","changeNotes"]); + break; + case "SnippetExists": + utils.addToPayload(opt,["snippetName"]); + break; + case "StartSiteWorkflow": + utils.addToPayload(opt,["workflowName","associationData"]); + break; + case "StartWorkflow": + utils.addToPayload(opt,["fileUrl","workflowName","associationData"]); + break; + case "StartWorkflowOnListItem": + utils.addToPayload(opt,["itemId","listName","workflowName","associationData"]); + break; + case "TemplateExists": + utils.addToPayload(opt,["templateName"]); + break; + case "TerminateWorkflow": + utils.addToPayload(opt,["listId","itemId","instanceId"]); + break; + case "TerminateWorkflowByName": + utils.addToPayload(opt,["fileUrl","workflowName","terminatePreviousInstances"]); + break; + case "TerminateWorkflowByNameForListItem": + utils.addToPayload(opt,["listName","itemId","workflowName","terminatePreviousInstances"]); + break; + case "WorkflowExists": + utils.addToPayload(opt,["workflowName","listId","workflowType"]); + break; + case "WorkflowFormProductSelected": + utils.addToPayload(opt,["workflowConfiguration","activityConfiguration","product","formType"]); + break; + default: + break; + }//end switch + + // Glue together the pieces of the SOAP message + var msg = SOAPEnvelope.header + SOAPEnvelope.opheader + SOAPEnvelope.payload + SOAPEnvelope.opfooter + SOAPEnvelope.footer; + + // Check to see if we've already cached the results + var cachedPromise; + if (opt.cacheXML) { + cachedPromise = promisesCache[msg]; + } + + if (typeof cachedPromise === "undefined") { + + // Finally, make the Ajax call + var p = $.ajax({ + // The relative URL for the AJAX call + url: ajaxURL, + // By default, the AJAX calls are asynchronous. You can specify false to require a synchronous call. + async: opt.async, + // Before sending the msg, need to send the request header + beforeSend: function (xhr) { + // If we need to pass the SOAPAction, do so + if (WSops[opt.operation][1]) { + xhr.setRequestHeader("SOAPAction", SOAPAction); + } + }, + // Always a POST + type: "POST", + // Here is the SOAP request we've built above + data: msg, + // We're getting XML; tell jQuery so that it doesn't need to do a best guess + dataType: "xml", + // and this is its content type + contentType: "text/xml;charset='utf-8'", + complete: function (xData, Status) { + // When the call is complete, call the completefunc if there is one + if ($.isFunction(opt.completefunc)) { + opt.completefunc(xData, Status); + + } + } + }); + if(opt.cacheXML) { + promisesCache[msg] = p; + } + + // Return the promise + return p; + + } else { + + // Call the completefunc if there is one + if ($.isFunction(opt.completefunc)) { + cachedPromise.done(function(data, status, jqXHR){ + opt.completefunc(jqXHR, status); + }); + + } + // Return the cached promise + return cachedPromise; + } + };//end NintexServices + + + // Defaults added as a function in our library means that the caller can override the defaults + // for their session by calling this function. Each operation requires a different set of options; + // we allow for all in a standardized way. + $.fn.SPServices.defaults = { + + cacheXML: false, // If true, we'll cache the XML results with jQuery's .data() function + operation: "", // The Web Service operation + webURL: "", // URL of the target Web + customHeaders: {}, + makeViewDefault: false, // true to make the view the default view for the list + + // For operations requiring CAML, these options will override any abstractions + viewName: "", // View name in CAML format. + CAMLQuery: "", // Query in CAML format + CAMLViewFields: "", // View fields in CAML format + CAMLRowLimit: 0, // Row limit as a string representation of an integer + CAMLQueryOptions: "", // Query options in CAML format + + // Abstractions for CAML syntax + batchCmd: "Update", // Method Cmd for UpdateListItems + valuepairs: [], // Fieldname / Fieldvalue pairs for UpdateListItems + + // As of v0.7.1, removed all options which were assigned an empty string ("") + DestinationUrls: [], // Array of destination URLs for copy operations + behavior: "Version3", // An SPWebServiceBehavior indicating whether the client supports Windows SharePoint Services 2.0 or Windows SharePoint Services 3.0: {Version2 | Version3 } + storage: "Shared", // A Storage value indicating how the Web Part is stored: {None | Personal | Shared} + objectType: "List", // objectType for operations which require it + cancelMeeting: true, // true to delete a meeting;false to remove its association with a Meeting Workspace site + nonGregorian: false, // true if the calendar is set to a format other than Gregorian;otherwise, false. + fClaim: false, // Specifies if the action is a claim or a release. Specifies true for a claim and false for a release. + recurrenceId: 0, // The recurrence ID for the meeting that needs its association removed. This parameter can be set to 0 for single-instance meetings. + sequence: 0, // An integer that is used to determine the ordering of updates in case they arrive out of sequence. Updates with a lower-than-current sequence are discarded. If the sequence is equal to the current sequence, the latest update are applied. + maximumItemsToReturn: 0, // SocialDataService maximumItemsToReturn + startIndex: 0, // SocialDataService startIndex + isHighPriority: false, // SocialDataService isHighPriority + isPrivate: false, // SocialDataService isPrivate + rating: 1, // SocialDataService rating + maxResults: 10, // Unless otherwise specified, the maximum number of principals that can be returned from a provider is 10. + principalType: "User", // Specifies user scope and other information: [None | User | DistributionList | SecurityGroup | SharePointGroup | All] + + async: true, // Allow the user to force async + completefunc: null // Function to call on completion + + }; // End $.fn.SPServices.defaults + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +/** + * General purpose utilities + * + * @namespace spservices.utils + */ +define([ + "jquery", + '../utils/constants' +], function( + $, + constants +){ + "use strict"; + + var utils = /** @lends spservices.utils */{ + + // Get the current context (as much as we can) on startup + // See: http://johnliu.net/blog/2012/2/3/sharepoint-javascript-current-page-context-info.html + SPServicesContext: function(options) { + + var opt = $.extend({}, { + listName: "", // The list the form is working with. This is useful if the form is not in the list context. + thisUserId: "" // The current user's id in the site Collection. + }, options); + + // The SharePoint variables only give us a relative path. to match the result from WebUrlFromPageUrl, we need to add the protocol, host, and (if present) port. + var siteRoot = location.protocol + "//" + location.host; // + (location.port !== "" ? location.port : ""); + + var thisContext = {}; + // SharePoint 2010+ gives us a context variable + if (typeof _spPageContextInfo !== "undefined") { + thisContext.thisSite = siteRoot + _spPageContextInfo.webServerRelativeUrl; + thisContext.thisList = opt.listName ? opt.listName : _spPageContextInfo.pageListId; + thisContext.thisUserId = opt.thisUserId ? opt.thisUserId : _spPageContextInfo.userId; + // In SharePoint 2007, we know the UserID only + } else { + thisContext.thisSite = (typeof L_Menu_BaseUrl !== "undefined") ? siteRoot + L_Menu_BaseUrl : ""; + thisContext.thisList = opt.listName ? opt.listName : ""; + thisContext.thisUserId = opt.thisUserId ? opt.thisUserId : ((typeof _spUserId !== "undefined") ? _spUserId : undefined); + } + + return thisContext; + + }, // End of function SPServicesContext + + // Global variables +// currentContext: new this.SPServicesContext(), // Variable to hold the current context as we figure it out + + /** + * Wrap an XML node (n) around a value (v) + * + */ + wrapNode: function(n, v) { + var thisValue = typeof v !== "undefined" ? v : ""; + return "<" + n + ">" + thisValue + ""; + }, + + /** + * Generate a random number for sorting arrays randomly + */ + randOrd: function() { + return (Math.round(Math.random()) - 0.5); + }, + + /** + * If a string is a URL, format it as a link, else return the string as-is + */ + checkLink: function(s) { + return ((s.indexOf("http") === 0) || (s.indexOf("/") === 0)) ? "" + s + "" : s; + }, + + /** + * Get the filename from the full URL + */ + fileName: function (s) { + return s.substring(s.lastIndexOf("/") + 1, s.length); + }, + + /** + * A map of special characters to XML escaped characters. + * Taken from {@link http://dracoblue.net/dev/encodedecode-special-xml-characters-in-javascript/155/} + * + * @type {Object} + */ + xml_special_to_escaped_one_map: { + '&': '&', + '"': '"', + '<': '<', + '>': '>' + }, + + // Paul T., 2015.05.01: Commented out since its not currently used. + // var escaped_one_to_xml_special_map = { + // '&': '&', + // '"': '"', + // '<': '<', + // '>': '>' + // }; + + /** + * Encode XML characters in a string + * + * @param {String} string + */ + encodeXml: function(string) { + return string.replace(/([\&"<>])/g, function (str, item) { + return this.xml_special_to_escaped_one_map[item]; + }); + }, + + // Paul T., 2015-05-02: Commented out since its not currently used. + // function decodeXml(string) { + // return string.replace(/("|<|>|&)/g, + // function (str, item) { + // return escaped_one_to_xml_special_map[item]; + // }); + // } + + /* Taken from http://dracoblue.net/dev/encodedecode-special-xml-characters-in-javascript/155/ */ + + /** + * Escape column values + */ + escapeColumnValue: function(s) { + if (typeof s === "string") { + return s.replace(/&(?![a-zA-Z]{1,8};)/g, "&"); + } else { + return s; + } + }, + + /** + * Escape Url + */ + escapeUrl: function (u) { + return u.replace(/&/g, '%26'); + }, + + /** + * Split values like 1;#value into id and value + * @type Class + */ + SplitIndex: function(s) { + var spl = s.split(constants.spDelim); + this.id = spl[0]; + this.value = spl[1]; + }, + + /** + * Pad single digits with a zero + * + * @param {Number} n + */ + pad: function (n) { + return n < 10 ? "0" + n : n; + }, +// TODO + // James Padolsey's Regex Selector for jQuery http://james.padolsey.com/javascript/regex-selector-for-jquery/ + /* $.expr[':'].regex = function (elem, index, match) { + var matchParams = match[3].split(','), + validLabels = /^(data|css):/, + attr = { + method: matchParams[0].match(validLabels) ? + matchParams[0].split(':')[0] : 'attr', + property: matchParams.shift().replace(validLabels, '') + }, + regexFlags = 'ig', + regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g, ''), regexFlags); + return regex.test($(elem)[attr.method](attr.property)); + }; + */ + + /** + * Build an error message based on passed parameters + */ + errBox: function(func, param, msg) { + var errMsg = "Error in function
" + func + "
" + + "Parameter
" + param + "
" + + "Message
" + msg + "

" + + "Click to continue"; + modalBox(errMsg); + }, // End of function errBox + + + // Finds the td which contains a form field in default forms using the comment which contains: + // + // as the "anchor" to find it. Necessary because SharePoint doesn't give all field types ids or specific classes. + findFormField: function(v) { + var $formBody = $("td.ms-formbody, td.ms-formbodysurvey"), + // Borrowed from MDN. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions + escapeRegExp = function (v){ + return v.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); + }, + columnName = escapeRegExp(v), + rcommentValidation = new RegExp("(?:Field|FieldInternal)Name=\"" + columnName + "\"", "i"), + $columnNode = $formBody.contents().filter(function () { + return this.nodeType === 8 && rcommentValidation.test(this.nodeValue); + }) + + ; + + return $columnNode.parent("td"); + }, // End of function findFormField + + // Show a single attribute of a node, enclosed in a table + // node The XML node + // opt The current set of options + showAttrs: function(node) { + var i; + var out = ""; + for (i = 0; i < node.attributes.length; i++) { + out += ""; + } + out += "
" + i + "" + + node.attributes.item(i).nodeName + "" + utils.checkLink(node.attributes.item(i).nodeValue) + "
"; + return out; + }, // End of function showAttrs + + // Add the option values to the SPServices.SOAPEnvelope.payload for the operation + // opt = options for the call + // SOAPEnvelope = envelope to add to + // paramArray = an array of option names to add to the payload + // "paramName" if the parameter name and the option name match + // ["paramName", "optionName"] if the parameter name and the option name are different (this handles early "wrappings" with inconsistent naming) + // {name: "paramName", sendNull: false} indicates the element is marked as "add to payload only if non-null" + addToPayload: function(opt, SOAPEnvelope, paramArray) { + + var i; + + for (i = 0; i < paramArray.length; i++) { + // the parameter name and the option name match + if (typeof paramArray[i] === "string") { + SOAPEnvelope.payload += utils.wrapNode(paramArray[i], opt[paramArray[i]]); + // the parameter name and the option name are different + } else if ($.isArray(paramArray[i]) && paramArray[i].length === 2) { + SOAPEnvelope.payload += utils.wrapNode(paramArray[i][0], opt[paramArray[i][1]]); + // the element not a string or an array and is marked as "add to payload only if non-null" + } else if ((typeof paramArray[i] === "object") && (paramArray[i].sendNull !== undefined)) { + SOAPEnvelope.payload += ((opt[paramArray[i].name] === undefined) || (opt[paramArray[i].name].length === 0)) ? "" : utils.wrapNode(paramArray[i].name, opt[paramArray[i].name]); + // something isn't right, so report it + } else { + utils.errBox(opt.operation, "paramArray[" + i + "]: " + paramArray[i], "Invalid paramArray element passed to addToPayload()"); + } + } + }, // End of function addToPayload + + + // The SiteData operations have the same names as other Web Service operations. To make them easy to call and unique, I'm using + // the SiteData prefix on their names. This function replaces that name with the right name in the SPServices.SOAPEnvelope. + siteDataFixSOAPEnvelope: function(SOAPEnvelope, siteDataOperation) { + var siteDataOp = siteDataOperation.substring(8); + SOAPEnvelope.opheader = SOAPEnvelope.opheader.replace(siteDataOperation, siteDataOp); + SOAPEnvelope.opfooter = SOAPEnvelope.opfooter.replace(siteDataOperation, siteDataOp); + return SOAPEnvelope; + }, // End of function siteDataFixSOAPEnvelope + + + /** + * Get the URL for a specified form for a list + * + * @param {Object} l + * @param {Object} f + */ + getListFormUrl: function(l, f) { + + var u; + $().SPServices({ + operation: "GetFormCollection", + async: false, + listName: l, + completefunc: function (xData) { + u = $(xData.responseXML).find("Form[Type='" + f + "']").attr("Url"); + } + }); + return u; + + }, // End of function getListFormUrl + + /** + * Returns the selected value(s) for a dropdown in an array. Expects a dropdown + * object as returned by the DropdownCtl function. + * If matchOnId is true, returns the ids rather than the text values for the + * selection options(s). + * + * @param {Object} columnSelect + * @param {Object} matchOnId + */ + getDropdownSelected: function (columnSelect, matchOnId) { + + var columnSelectSelected = []; + + switch (columnSelect.Type) { + case constants.dropdownType.simple: + if (matchOnId) { + columnSelectSelected.push(columnSelect.Obj.find("option:selected").val() || []); + } else { + columnSelectSelected.push(columnSelect.Obj.find("option:selected").text() || []); + } + break; + case constants.dropdownType.complex: + if (matchOnId) { + columnSelectSelected.push(columnSelect.optHid.val() || []); + } else { + columnSelectSelected.push(columnSelect.Obj.val() || []); + } + break; + case constants.dropdownType.multiSelect: + $(columnSelect.master.resultControl).find("option").each(function () { + if (matchOnId) { + columnSelectSelected.push($(this).val()); + } else { + columnSelectSelected.push($(this).html()); + } + }); + break; + default: + break; + } + return columnSelectSelected; + + }, // End of function getDropdownSelected + + + /** + * Generate a unique id for a containing div using the function name and the column display name. + * + * @param {Object} funcname + * @param {Object} columnName + * @param {Object} listName + */ + genContainerId: function(funcname, columnName, listName) { + var l = listName !== undefined ? listName : $().SPServices.SPListNameFromUrl(); + return funcname + "_" + $().SPServices.SPGetStaticFromDisplay({ + listName: l, + columnDisplayName: columnName + }); + } // End of function genContainerId + + }, //end: utils + + //-----------[ PRIVATE METHODS BELOW ]--------------------- + // These should all be defined against a local variable so + // that we get smaller minified files + + /** + * Call this function to pop up a branded modal msgBox + * @private + */ + modalBox = function(msg) { + var boxCSS = "position:absolute;width:300px;height:150px;padding:10px;background-color:#000000;color:#ffffff;z-index:30;font-family:'Arial';font-size:12px;display:none;"; + $("#aspnetForm").parent().append("
" + msg); + var msgBoxObj = $("#SPServices_msgBox"); + var height = msgBoxObj.height(); + var width = msgBoxObj.width(); + var leftVal = ($(window).width() / 2) - (width / 2) + "px"; + var topVal = ($(window).height() / 2) - (height / 2) - 100 + "px"; + msgBoxObj.css({ + border: '5px #C02000 solid', + left: leftVal, + top: topVal + }).show().fadeTo("slow", 0.75).click(function () { + $(this).fadeOut("3000", function () { + $(this).remove(); + }); + }); + }; // End of function modalBox; + + + return utils; + +}); + + +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../utils/constants', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants +) { + + "use strict"; + + // Return the current version of SPServices as a string + $.fn.SPServices.Version = function () { + + return constants.VERSION; + + }; // End $.fn.SPServices.Version + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([], function () { + + "use strict"; + + /** + * Maintains a set of constants for SPServices. + * + * @namespace constants + */ + + var constants = { + + // Version info + VERSION: "@VERSION", // update it in package.json... build takes care of the rest + + // Simple strings + spDelim: ";#", + SLASH: "/", + TXTColumnNotFound: "Column not found on page", + + // String constants + // General + SCHEMASharePoint: "http://schemas.microsoft.com/sharepoint", + SCHEMANintex: "http://nintex.com", + multiLookupPrefix: "MultiLookupPicker", + multiLookupPrefix2013: "MultiLookup", + + // Dropdown Types + dropdownType: { + simple: "S", + complex: "C", + multiSelect: "M" + }, + + // Known list field types - See: http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.spfieldtype(v=office.15).aspx + spListFieldTypes: [ + "Integer", + "Text", + "Note", + "DateTime", + "Counter", + "Choice", + "Lookup", + "Boolean", + "Number", + "Currency", + "URL", +// "Computed", // NEW +// "Threading", // NEW +// "Guid", // NEW + "MultiChoice", +// "GridChoice", // NEW + "Calculated", + "File", + "Attachments", + "User", + "Recurrence", // Recurring event indicator (boolean) [0 | 1] +// "CrossProjectLink", // NEW + "ModStat", + "ContentTypeId", +// "PageSeparator", // NEW +// "ThreadIndex", // NEW + "WorkflowStatus", // NEW + "AllDayEvent", // All day event indicator (boolean) [0 | 1] +// "WorkflowEventType", // NEW +// "Geolocation", // NEW +// "OutcomeChoice", // NEW + "RelatedItems", // Related Items in a Workflow Tasks list + + // Also seen + "UserMulti", // Multiselect users + "LookupMulti", // Multi-select lookup + "datetime", // Calculated date/time result + "float", // Calculated float + "Calc" // General calculated + ] + + }; + + return constants; + +}); + +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../utils/constants', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + // Convert a JavaScript date to the ISO 8601 format required by SharePoint to update list items + $.fn.SPServices.SPConvertDateToISO = function (options) { + + var opt = $.extend({}, { + dateToConvert: new Date(), // The JavaScript date we'd like to convert. If no date is passed, the function returns the current date/time + dateOffset: "-05:00" // The time zone offset requested. Default is EST + }, options); + + //Generate ISO 8601 date/time formatted string + var s = ""; + var d = opt.dateToConvert; + s += d.getFullYear() + "-"; + s += utils.pad(d.getMonth() + 1) + "-"; + s += utils.pad(d.getDate()); + s += "T" + utils.pad(d.getHours()) + ":"; + s += utils.pad(d.getMinutes()) + ":"; + s += utils.pad(d.getSeconds()) + "Z" + opt.dateOffset; + //Return the ISO8601 date string + return s; + + }; // End $.fn.SPServices.SPConvertDateToISO + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core.js' +], function ( + $, + utils +) { + + "use strict"; + + // Utility function to show the results of a Web Service call formatted well in the browser. + $.fn.SPServices.SPDebugXMLHttpResult = function (options) { + + var opt = $.extend({}, { + node: null, // An XMLHttpResult object from an ajax call + indent: 0 // Number of indents + }, options); + + var i; + var NODE_TEXT = 3; + var NODE_CDATA_SECTION = 4; + + var outString = ""; + // For each new subnode, begin rendering a new TABLE + outString += ""; + // DisplayPatterns are a bit unique, so let's handle them differently + if (opt.node.nodeName === "DisplayPattern") { + outString += ""; + // A node which has no children + } else if (!opt.node.hasChildNodes()) { + outString += ""; + if (opt.node.attributes) { + outString += ""; + } + // A CDATA_SECTION node + } else if (opt.node.hasChildNodes() && opt.node.firstChild.nodeType === NODE_CDATA_SECTION) { + outString += ""; + // A TEXT node + } else if (opt.node.hasChildNodes() && opt.node.firstChild.nodeType === NODE_TEXT) { + outString += ""; + // Handle child nodes + } else { + outString += ""; + if (opt.node.attributes) { + outString += ""; + } + // Since the node has child nodes, recurse + outString += ""; + } + outString += "
" + opt.node.nodeName + + "
" + opt.node.nodeName + + "" + ((opt.node.nodeValue !== null) ? utils.checkLink(opt.node.nodeValue) : " ") + "
" + utils.showAttrs(opt.node) + "
" + opt.node.nodeName + + "
" + opt.node.nodeName + + "" + utils.checkLink(opt.node.firstChild.nodeValue) + "
" + opt.node.nodeName + "
" + utils.showAttrs(opt.node) + "
"; + for (i = 0; i < opt.node.childNodes.length; i++) { + outString += $().SPServices.SPDebugXMLHttpResult({ + node: opt.node.childNodes.item(i), + indent: opt.indent + 1 + }); + } + outString += "
"; + // Return the HTML which we have built up + return outString; + }; // End $.fn.SPServices.SPDebugXMLHttpResult + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../core/SPServices.utils', + "../utils/constants", + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + utils, + constants +) { + + "use strict"; + + // Find a dropdown (or multi-select) in the DOM. Returns the dropdown object and its type: + // S = Simple (select) + // C = Compound (input + select hybrid) + // M = Multi-select (select hybrid) + $.fn.SPServices.SPDropdownCtl = function (options) { + + var opt = $.extend({}, { + displayName: "" // The displayName of the column on the form + }, options); + + var columnObj = {}; + +// Paul T., 2015.05.02: Commented out since is not currently used + // var colStaticName = $().SPServices.SPGetStaticFromDisplay({ + // listName: $().SPServices.SPListNameFromUrl(), + // columnDisplayName: opt.displayName + // }); + + // Simple, where the select's title attribute is colName (DisplayName) + // Examples: + // SP2013 + // SP2007: +// } else if ((columnObj.Obj = $("select:regex(id, (" + colStaticName + ")(_)[0-9a-fA-F]{8}(-))")).length === 1) { +// columnObj.Type = constants.dropdownType.simple; + // Multi-select: This will find the multi-select column control in English and most other language sites where the Title looks like 'Column Name possible values' + } else if ((columnObj.Obj = $("select[ID$='SelectCandidate'][Title^='" + opt.displayName + " ']")).length === 1) { + columnObj.Type = constants.dropdownType.multiSelect; + // Multi-select: This will find the multi-select column control on a Russian site (and perhaps others) where the Title looks like '????????? ????????: Column Name' + } else if ((columnObj.Obj = $("select[ID$='SelectCandidate'][Title$=': " + opt.displayName + "']")).length === 1) { + columnObj.Type = constants.dropdownType.multiSelect; + // Multi-select: This will find the multi-select column control on a German site (and perhaps others) + } else if ((columnObj.Obj = $("select[ID$='SelectCandidate'][Title$='\"" + opt.displayName + "\".']")).length === 1) { + columnObj.Type = constants.dropdownType.multiSelect; + // Multi-select: This will find the multi-select column control on a Italian site (and perhaps others) where the Title looks like "Valori possibili Column name" + } else if ((columnObj.Obj = $("select[ID$='SelectCandidate'][Title$=' " + opt.displayName + "']")).length === 1) { + columnObj.Type = constants.dropdownType.multiSelect; + } else { + columnObj.Type = null; + } + + // Last ditch effort + // Simple, finding based on the comment text at the top of the td.ms-formbody where the select's title begins with DisplayName - needed for required columns where title="DisplayName Required Field" + // Examples: SP2010 + if (columnObj.Type === null) { + var fieldContainer = utils.findFormField(opt.displayName); + if (fieldContainer !== undefined) { + var fieldSelect1 = fieldContainer.find("select[title^='" + opt.displayName + " '][id$='_Lookup']"); + var fieldSelect2 = fieldContainer.find("select[title^='" + opt.displayName + " '][id$='LookupField']"); + var fieldSelect = fieldSelect1.length > 0 ? fieldSelect1 : fieldSelect2; + + if (fieldSelect && fieldSelect.length === 1) { + columnObj.Type = constants.dropdownType.simple; + columnObj.Obj = fieldSelect; + } + } + } + + if (columnObj.Type === constants.dropdownType.complex) { + columnObj.optHid = $("input[id='" + columnObj.Obj.attr("optHid") + "']"); + } else if (columnObj.Type === constants.dropdownType.multiSelect) { + // Find the important bits of the multiselect control + columnObj.container = columnObj.Obj.closest("span"); + columnObj.MultiLookupPickerdata = columnObj.container.find("input[id$='" + utils.multiLookupPrefix + "_data'], input[id$='" + utils.multiLookupPrefix2013 + "_data']"); + var addButtonId = columnObj.container.find("[id$='AddButton']").attr("id"); + columnObj.master = + window[addButtonId.replace(/AddButton/, constants.multiLookupPrefix + "_m")] || // SharePoint 2007 + window[addButtonId.replace(/AddButton/, constants.multiLookupPrefix2013 + "_m")]; // SharePoint 2013 + } + + return columnObj; + + }; // End of function $.fn.SPServices.SPDropdownCtl + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery' +], function ( + $ +) { + "use strict"; + + // This method for finding specific nodes in the returned XML was developed by Steve Workman. See his blog post + // http://www.steveworkman.com/html5-2/javascript/2011/improving-javascript-xml-node-finding-performance-by-2000/ + // for performance details. + $.fn.SPFilterNode = function (name) { + return this.find('*').filter(function () { + return this.nodeName === name; + }); + }; // End $.fn.SPFilterNode + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../utils/constants', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + var SPServices = window.SPServices || {}; + + // Function to determine the current Web's URL. We need this for successful Ajax calls. + // The function is also available as a public function. + $.fn.SPServices.SPGetCurrentSite = function () { + + var currentContext = utils.SPServicesContext(); + + // We've already determined the current site... + if (currentContext.thisSite.length > 0) { + return currentContext.thisSite; + } + + // If we still don't know the current site, we call WebUrlFromPageUrlResult. + var msg = SPServices.SOAPEnvelope.header + + "" + + ((location.href.indexOf("?") > 0) ? location.href.substr(0, location.href.indexOf("?")) : location.href) + + "" + + SPServices.SOAPEnvelope.footer; + $.ajax({ + async: false, // Need this to be synchronous so we're assured of a valid value + url: "/_vti_bin/Webs.asmx", + type: "POST", + data: msg, + dataType: "xml", + contentType: "text/xml;charset=\"utf-8\"", + complete: function (xData) { + currentContext.thisSite = $(xData.responseXML).find("WebUrlFromPageUrlResult").text(); + } + }); + + return currentContext.thisSite; // Return the URL + + }; // End $.fn.SPServices.SPGetCurrentSite + + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + utils +) { + + "use strict"; + + // Function which returns the account name for the current user in DOMAIN\username format + $.fn.SPServices.SPGetCurrentUser = function (options) { + + var opt = $.extend({}, { + webURL: "", // URL of the target Site Collection. If not specified, the current Web is used. + fieldName: "Name", // Specifies which field to return from the userdisp.aspx page + fieldNames: {}, // Specifies which fields to return from the userdisp.aspx page - added in v0.7.2 to allow multiple columns + debug: false // If true, show error messages; if false, run silent + }, options); + + var currentContext = utils.SPServicesContext(); + + // The current user's ID is reliably available in an existing JavaScript variable + if (opt.fieldName === "ID" && typeof currentContext.thisUserId !== "undefined") { + return currentContext.thisUserId; + } + + var thisField = ""; + var theseFields = {}; + var fieldCount = opt.fieldNames.length > 0 ? opt.fieldNames.length : 1; + var thisUserDisp; + var thisWeb = opt.webURL.length > 0 ? opt.webURL : $().SPServices.SPGetCurrentSite(); + + // Get the UserDisp.aspx page using AJAX + $.ajax({ + // Need this to be synchronous so we're assured of a valid value + async: false, + // Force parameter forces redirection to a page that displays the information as stored in the UserInfo table rather than My Site. + // Adding the extra Query String parameter with the current date/time forces the server to view this as a new request. + url: ((thisWeb === "/") ? "" : thisWeb) + "/_layouts/userdisp.aspx?Force=True&" + new Date().getTime(), + complete: function (xData) { + thisUserDisp = xData; + } + }); + + for (var i = 0; i < fieldCount; i++) { + + // The current user's ID is reliably available in an existing JavaScript variable + if (opt.fieldNames[i] === "ID") { + thisField = currentContext.thisUserId; + } else { + var thisTextValue; + if (fieldCount > 1) { + thisTextValue = RegExp("FieldInternalName=\"" + opt.fieldNames[i] + "\"", "gi"); + } else { + thisTextValue = RegExp("FieldInternalName=\"" + opt.fieldName + "\"", "gi"); + } + $(thisUserDisp.responseText).find("table.ms-formtable td[id^='SPField']").each(function () { + if (thisTextValue.test($(this).html())) { + // Each fieldtype contains a different data type, as indicated by the id + switch ($(this).attr("id")) { + case "SPFieldText": + thisField = $(this).text(); + break; + case "SPFieldNote": + thisField = $(this).find("div").html(); + break; + case "SPFieldURL": + thisField = $(this).find("img").attr("src"); + break; + // Just in case + default: + thisField = $(this).text(); + break; + } + // Stop looking; we're done + return false; + } + }); + } + if (opt.fieldNames[i] !== "ID") { + thisField = (typeof thisField !== "undefined") ? thisField.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g, '') : null; + } + if (fieldCount > 1) { + theseFields[opt.fieldNames[i]] = thisField; + } + } + + return (fieldCount > 1) ? theseFields : thisField; + + }; // End $.fn.SPServices.SPGetCurrentUser + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $ +) { + + "use strict"; + + // This function returns the DisplayName for a column based on the StaticName. + $.fn.SPServices.SPGetDisplayFromStatic = function (options) { + + var opt = $.extend({}, { + webURL: "", // URL of the target Web. If not specified, the current Web is used. + listName: "", // The name or GUID of the list + columnStaticName: "", // StaticName of the column + columnStaticNames: {} // StaticName of the columns - added in v0.7.2 to allow multiple columns + }, options); + + var displayName = ""; + var displayNames = {}; + var nameCount = opt.columnStaticNames.length > 0 ? opt.columnStaticNames.length : 1; + + $().SPServices({ + operation: "GetList", + async: false, + cacheXML: true, + webURL: opt.webURL, + listName: opt.listName, + completefunc: function (xData) { + if (nameCount > 1) { + for (var i = 0; i < nameCount; i++) { + displayNames[opt.columnStaticNames[i]] = $(xData.responseXML).find("Field[StaticName='" + opt.columnStaticNames[i] + "']").attr("DisplayName"); + } + } else { + displayName = $(xData.responseXML).find("Field[StaticName='" + opt.columnStaticName + "']").attr("DisplayName"); + } + } + }); + + return (nameCount > 1) ? displayNames : displayName; + + }; // End $.fn.SPServices.SPGetDisplayFromStatic + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $ +) { + + "use strict"; + + // Function to return the ID of the last item created on a list by a specific user. Useful for maintaining parent/child relationships + // between list forms + $.fn.SPServices.SPGetLastItemId = function (options) { + + var opt = $.extend({}, { + webURL: "", // URL of the target Web. If not specified, the current Web is used. + listName: "", // The name or GUID of the list + userAccount: "", // The account for the user in DOMAIN\username format. If not specified, the current user is used. + CAMLQuery: "" // [Optional] For power users, this CAML fragment will be Anded with the default query on the relatedList + }, options); + + var userId; + var lastId = 0; + $().SPServices({ + operation: "GetUserInfo", + webURL: opt.webURL, + async: false, + userLoginName: (opt.userAccount !== "") ? opt.userAccount : $().SPServices.SPGetCurrentUser(), + completefunc: function (xData) { + $(xData.responseXML).find("User").each(function () { + userId = $(this).attr("ID"); + }); + } + }); + + // Get the list items for the user, sorted by Created, descending. If the CAMLQuery option has been specified, And it with + // the existing Where clause + var camlQuery = ""; + if (opt.CAMLQuery.length > 0) { + camlQuery += ""; + } + camlQuery += "" + userId + ""; + if (opt.CAMLQuery.length > 0) { + camlQuery += opt.CAMLQuery + ""; + } + camlQuery += ""; + + $().SPServices({ + operation: "GetListItems", + async: false, + webURL: opt.webURL, + listName: opt.listName, + CAMLQuery: camlQuery, + CAMLViewFields: "", + CAMLRowLimit: 1, + CAMLQueryOptions: "", + completefunc: function (xData) { + $(xData.responseXML).SPFilterNode("z:row").each(function () { + lastId = $(this).attr("ows_ID"); + }); + } + }); + return lastId; + }; // End $.fn.SPServices.SPGetLastItemId + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../utils/constants', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants +) { + + "use strict"; + + // SPGetListItemsJson retrieves items from a list in JSON format + $.fn.SPServices.SPGetListItemsJson = function (options) { + + var opt = $.extend({}, { + webURL: "", // [Optional] URL of the target Web. If not specified, the current Web is used. + listName: "", + viewName: "", + CAMLQuery: "", + CAMLViewFields: "", + CAMLRowLimit: "", + CAMLQueryOptions: "", + changeToken: "", // [Optional] If provided, will be passed with the request + contains: "", // CAML snippet for an additional filter + mapping: null, // If provided, use this mapping rather than creating one automagically from the list schema + mappingOverrides: null, // Pass in specific column overrides here + debug: false // If true, show error messages;if false, run silent + }, $().SPServices.defaults, options); + + var newChangeToken; + var thisListJsonMapping = {}; + var deletedIds = []; + var result = $.Deferred(); + + // Call GetListItems to find all of the items matching the CAMLQuery + var thisData = $().SPServices({ + operation: "GetListItemChangesSinceToken", + webURL: opt.webURL, + listName: opt.listName, + viewName: opt.viewName, + CAMLQuery: opt.CAMLQuery, + CAMLViewFields: opt.CAMLViewFields, + CAMLRowLimit: opt.CAMLRowLimit, + CAMLQueryOptions: opt.CAMLQueryOptions, + changeToken: opt.changeToken, + contains: opt.contains + }); + + thisData.then(function () { + + var mappingKey = "SPGetListItemsJson" + opt.webURL + opt.listName; + + // We're going to use this multiple times + var responseXml = $(thisData.responseXML); + + // Get the changeToken + newChangeToken = responseXml.find("Changes").attr("LastChangeToken"); + + // Some of the existing items may have been deleted + responseXml.find("listitems Changes Id[ChangeType='Delete']").each(function () { + deletedIds.push($(this).text()); + }); + + if (opt.mapping === null) { + // Automagically create the mapping + responseXml.find("List > Fields > Field").each(function () { + var thisField = $(this); + var thisType = thisField.attr("Type"); + // Only work with known column types + if ($.inArray(thisType, constants.spListFieldTypes) >= 0) { + thisListJsonMapping["ows_" + thisField.attr("Name")] = { + mappedName: thisField.attr("Name"), + objectType: thisField.attr("Type") + }; + } + + }); + + } else { + thisListJsonMapping = opt.mapping; + } + + // Implement any mappingOverrides + // Example: { ows_JSONTextColumn: { mappedName: "JTC", objectType: "JSON" } } + if (opt.mappingOverrides !== null) { + // For each mappingOverride, override the list schema + for (var mapping in opt.mappingOverrides) { + thisListJsonMapping[mapping] = opt.mappingOverrides[mapping]; + } + } + + // If we haven't retrieved the list schema in this call, try to grab it from the saved data from a prior call + if ($.isEmptyObject(thisListJsonMapping)) { + thisListJsonMapping = $(document).data(mappingKey); + } else { + $(document).data(mappingKey, thisListJsonMapping); + } + + var jsonData = responseXml.SPFilterNode("z:row").SPXmlToJson({ + mapping: thisListJsonMapping, + sparse: true + }); + + var thisResult = { + changeToken: newChangeToken, + mapping: thisListJsonMapping, + data: jsonData, + deletedIds: deletedIds + }; + + result.resolveWith(thisResult); + + }, + function (err) { + result.rejectWith(err); + }); + + return result.promise(); + + }; // End $.fn.SPServices.SPGetListItemsJson + + return $; + +}); + +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery' +], function ( + $ +) { + + "use strict"; + + // Get the Query String parameters and their values and return in an array + // Includes code from http://www.developerdrive.com/2013/08/turning-the-querystring-into-a-json-object-using-javascript/ + // Simplified in 2014.01 using this code + $.fn.SPServices.SPGetQueryString = function (options) { + + var opt = $.extend({}, { + lowercase: false // If true, parameter names will be converted to lowercase + }, options); + + var queryStringVals = {}; + + var qs = location.search.slice(1).split('&'); + + for (var i = 0; i < qs.length; i++) { + var param = qs[i].split('='); + var paramName = opt.lowercase ? param[0].toLowerCase() : param[0]; + queryStringVals[paramName] = decodeURIComponent(param[1] || ""); + } + + return queryStringVals; + + }; // End $.fn.SPServices.SPGetQueryString + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $ +) { + + "use strict"; + + // This function returns the StaticName for a column based on the DisplayName. + $.fn.SPServices.SPGetStaticFromDisplay = function (options) { + + var opt = $.extend({}, { + webURL: "", // URL of the target Web. If not specified, the current Web is used. + listName: "", // The name or GUID of the list + columnDisplayName: "", // DisplayName of the column + columnDisplayNames: {} // DisplayNames of the columns - added in v0.7.2 to allow multiple columns + }, options); + + var staticName = ""; + var staticNames = {}; + var nameCount = opt.columnDisplayNames.length > 0 ? opt.columnDisplayNames.length : 1; + + $().SPServices({ + operation: "GetList", + async: false, + cacheXML: true, + webURL: opt.webURL, + listName: opt.listName, + completefunc: function (xData) { + if (nameCount > 1) { + for (var i = 0; i < nameCount; i++) { + staticNames[opt.columnDisplayNames[i]] = $(xData.responseXML).find("Field[DisplayName='" + opt.columnDisplayNames[i] + "']").attr("StaticName"); + } + } else { + staticName = $(xData.responseXML).find("Field[DisplayName='" + opt.columnDisplayName + "']").attr("StaticName"); + } + } + }); + + return (nameCount > 1) ? staticNames : staticName; + + }; // End $.fn.SPServices.SPGetStaticFromDisplay + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../utils/constants', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + $.fn.SPServices.SPListNameFromUrl = function (options) { + + var opt = $.extend({}, { + listName: "" // [Optional] Pass in the name or GUID of a list if you are not in its context. e.g., on a Web Part pages in the Pages library + }, options); + + var currentContext = utils.SPServicesContext(); + + // Has the list name or GUID been passed in? + if (opt.listName.length > 0) { +// TODO currentContext({ listName: opt.listName }); + return opt.listName; + // Do we already know the current list? + } else if (currentContext.thisList !== undefined && currentContext.thisList.length > 0) { + return currentContext.thisList; + } + + // Parse out the list's root URL from the current location or the passed url + var thisPage = location.href; + var thisPageBaseName = thisPage.substring(0, thisPage.indexOf(".aspx")); + var listPath = decodeURIComponent(thisPageBaseName.substring(0, thisPageBaseName.lastIndexOf(constants.SLASH) + 1)).toUpperCase(); + + // Call GetListCollection and loop through the results to find a match with the list's URL to get the list's GUID + $().SPServices({ + operation: "GetListCollection", + async: false, + completefunc: function (xData) { + $(xData.responseXML).find("List").each(function () { + var defaultViewUrl = $(this).attr("DefaultViewUrl"); + var listCollList = defaultViewUrl.substring(0, defaultViewUrl.lastIndexOf(constants.SLASH) + 1).toUpperCase(); + if (listPath.indexOf(listCollList) > 0) { + currentContext.thisList = $(this).attr("ID"); + return false; + } + }); + } + }); + + // Return the list GUID (ID) + return currentContext.thisList; + + }; // End $.fn.SPServices.SPListNameFromUrl + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../utils/constants', + '../core/SPServices.utils' +], function ( + $, + constants, + utils +) { + + "use strict"; + + // This function converts an XML node set to JSON + // Initial implementation focuses only on GetListItems + $.fn.SPXmlToJson = function (options) { + + var opt = $.extend({}, { + mapping: {}, // columnName: mappedName: "mappedName", objectType: "objectType" + includeAllAttrs: false, // If true, return all attributes, regardless whether they are in the mapping + removeOws: true, // Specifically for GetListItems, if true, the leading ows_ will be stripped off the field name + sparse: false // If true, empty ("") values will not be returned + }, options); + + var attrNum; + var jsonObject = []; + + this.each(function () { + var row = {}; + var rowAttrs = this.attributes; + + if (!opt.sparse) { + // Bring back all mapped columns, even those with no value + $.each(opt.mapping, function () { + row[this.mappedName] = ""; + }); + } + + // Parse through the element's attributes + for (attrNum = 0; attrNum < rowAttrs.length; attrNum++) { + var thisAttrName = rowAttrs[attrNum].name; + var thisMapping = opt.mapping[thisAttrName]; + var thisObjectName = thisMapping && thisMapping.mappedName ? thisMapping.mappedName : opt.removeOws ? thisAttrName.split("ows_")[1] : thisAttrName; + var thisObjectType = thisMapping !== undefined ? thisMapping.objectType : undefined; + if (opt.includeAllAttrs || thisMapping !== undefined) { + row[thisObjectName] = attrToJson(rowAttrs[attrNum].value, thisObjectType); + } + } + // Push this item into the JSON Object + jsonObject.push(row); + + }); + + // Return the JSON object + return jsonObject; + + }; // End $.fn.SPServices.SPXmlToJson + + + function attrToJson(v, objectType) { + function identity(x) { return x; } + + var result = { + + /* Generic [Reusable] Functions */ + "Integer": intToJsonObject, + "Number": floatToJsonObject, + "Boolean": booleanToJsonObject, + "DateTime": dateToJsonObject, + "User": userToJsonObject, + "UserMulti": userMultiToJsonObject, + "Lookup": lookupToJsonObject, + "lookupMulti": lookupMultiToJsonObject, + "MultiChoice": choiceMultiToJsonObject, + "Calculated": calcToJsonObject, + "Attachments": attachmentsToJsonObject, + "URL": urlToJsonObject, + "JSON": jsonToJsonObject, // Special case for text JSON stored in text columns + + /* These objectTypes reuse above functions */ + "Text": result.Default, + "Counter": result.Integer, + "datetime": result.DateTime, // For calculated columns, stored as datetime;#value + "AllDayEvent": result.Boolean, + "Recurrence": result.Boolean, + "Currency": result.Number, + "float": result.Number, // For calculated columns, stored as float;#value + "RelatedItems": result.JSON, + + "Default": identity + }; + + return (result[objectType] || identity)(v); + +/* + switch (objectType) { + + case "Text": + colValue = v; + break; + case "DateTime": + case "datetime": // For calculated columns, stored as datetime;#value + // Dates have dashes instead of slashes: ows_Created="2009-08-25 14:24:48" + colValue = dateToJsonObject(v); + break; + case "User": + colValue = userToJsonObject(v); + break; + case "UserMulti": + colValue = userMultiToJsonObject(v); + break; + case "Lookup": + colValue = lookupToJsonObject(v); + break; + + case "LookupMulti": + colValue = lookupMultiToJsonObject(v); + break; + case "Boolean": + case "AllDayEvent": + case "Recurrence": + colValue = booleanToJsonObject(v); + break; + + case "Integer": + colValue = intToJsonObject(v); + break; + + case "Counter": + colValue = intToJsonObject(v); + break; + + case "MultiChoice": + colValue = choiceMultiToJsonObject(v); + break; + case "Number": + case "Currency": + case "float": // For calculated columns, stored as float;#value + colValue = floatToJsonObject(v); + break; + case "Calculated": + colValue = calcToJsonObject(v); + break; + case "Attachments": + colValue = attachmentsToJsonObject(v); + break; + case "URL": + colValue = urlToJsonObject(v); + break; + case "JSON": + case "RelatedItems": + colValue = jsonToJsonObject(v); // Special case for text JSON stored in text columns + break; + + default: + // All other objectTypes will be simple strings + colValue = v; + break; + } + return colValue; + */ + } + + function intToJsonObject(s) { + return parseInt(s, 10); + } + + function floatToJsonObject(s) { + return parseFloat(s); + } + + function booleanToJsonObject(s) { + return s !== "0"; + } + + function dateToJsonObject(s) { + + var dt = s.split("T")[0] !== s ? s.split("T") : s.split(" "); + var d = dt[0].split("-"); + var t = dt[1].split(":"); + var t3 = t[2].split("Z"); + return new Date(d[0], (d[1] - 1), d[2], t[0], t[1], t3[0]); + } + + function userToJsonObject(s) { + if (s.length === 0) { + return null; + } else { + var thisUser = new utils.SplitIndex(s); + var thisUserExpanded = thisUser.value.split(",#"); + if (thisUserExpanded.length === 1) { + return { + userId: thisUser.id, + userName: thisUser.value + }; + } else { + return { + userId: thisUser.id, + userName: thisUserExpanded[0].replace(/(,,)/g, ","), + loginName: thisUserExpanded[1].replace(/(,,)/g, ","), + email: thisUserExpanded[2].replace(/(,,)/g, ","), + sipAddress: thisUserExpanded[3].replace(/(,,)/g, ","), + title: thisUserExpanded[4].replace(/(,,)/g, ",") + }; + } + } + } + + function userMultiToJsonObject(s) { + if (s.length === 0) { + return null; + } else { + var thisUserMultiObject = []; + var thisUserMulti = s.split(constants.spDelim); + for (var i = 0; i < thisUserMulti.length; i = i + 2) { + var thisUser = userToJsonObject(thisUserMulti[i] + constants.spDelim + thisUserMulti[i + 1]); + thisUserMultiObject.push(thisUser); + } + return thisUserMultiObject; + } + } + + function lookupToJsonObject(s) { + if (s.length === 0) { + return null; + } else { + var thisLookup = s.split(constants.spDelim); + return { + lookupId: thisLookup[0], + lookupValue: thisLookup[1] + }; + } + } + + function lookupMultiToJsonObject(s) { + if (s.length === 0) { + return null; + } else { + var thisLookupMultiObject = []; + var thisLookupMulti = s.split(constants.spDelim); + for (var i = 0; i < thisLookupMulti.length; i = i + 2) { + var thisLookup = lookupToJsonObject(thisLookupMulti[i] + constants.spDelim + thisLookupMulti[i + 1]); + thisLookupMultiObject.push(thisLookup); + } + return thisLookupMultiObject; + } + } + + function choiceMultiToJsonObject(s) { + if (s.length === 0) { + return null; + } else { + var thisChoiceMultiObject = []; + var thisChoiceMulti = s.split(constants.spDelim); + for (var i = 0; i < thisChoiceMulti.length; i++) { + if (thisChoiceMulti[i].length !== 0) { + thisChoiceMultiObject.push(thisChoiceMulti[i]); + } + } + return thisChoiceMultiObject; + } + } + + function attachmentsToJsonObject(s) { + if (s.length === 0) { + return null; + } else if (s === "0" || s === "1") { + return s; + } else { + var thisObject = []; + var thisString = s.split(constants.spDelim); + for (var i = 0; i < thisString.length; i++) { + if (thisString[i].length !== 0) { + var fileName = thisString[i]; + if (thisString[i].lastIndexOf("/") !== -1) { + var tokens = thisString[i].split("/"); + fileName = tokens[tokens.length - 1]; + } + thisObject.push({ + attachment: thisString[i], + fileName: fileName + }); + } + } + return thisObject; + } + } + + function urlToJsonObject(s) { + if (s.length === 0) { + return null; + } else { + var thisUrl = s.split(", "); + return { + Url: thisUrl[0], + Description: thisUrl[1] + }; + } + } + + function calcToJsonObject(s) { + if (s.length === 0) { + return null; + } else { + var thisCalc = s.split(constants.spDelim); + // The first value will be the calculated column value type, the second will be the value + return attrToJson(thisCalc[1], thisCalc[0]); + } + } + + function jsonToJsonObject(s) { + if (s.length === 0) { + return null; + } else { + return $.parseJSON(s); + } + } + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + utils +) { + + "use strict"; + + // Rearrange radio buttons or checkboxes in a form from vertical to horizontal display to save page real estate + $.fn.SPServices.SPArrangeChoices = function (options) { + + var opt = $.extend({}, { + listName: $().SPServices.SPListNameFromUrl(), // The list name for the current form + columnName: "", // The display name of the column in the form + perRow: 99, // Maximum number of choices desired per row. + randomize: false // If true, randomize the order of the options + }, options); + + var columnFillInChoice = false; + var columnOptions = []; + + // Get information about columnName from the list to determine if we're allowing fill-in choices + var thisGetList = $().SPServices({ + operation: "GetList", + async: false, + cacheXML: true, + listName: opt.listName + }); + + // when the promise is available... + thisGetList.done(function () { + $(thisGetList.responseXML).find("Field[DisplayName='" + opt.columnName + "']").each(function () { + // Determine whether columnName allows a fill-in choice + columnFillInChoice = ($(this).attr("FillInChoice") === "TRUE"); + // Stop looking;we're done + return false; + }); + + var thisFormField = utils.findFormField(opt.columnName); + var totalChoices = $(thisFormField).find("tr").length; + var fillinPrompt; + var fillinInput; + + // Collect all of the choices + $(thisFormField).find("tr").each(function (choiceNumber) { + // If this is the fill-in prompt, save it... + if (columnFillInChoice && choiceNumber === (totalChoices - 2)) { + fillinPrompt = $(this).find("td"); + // ...or if it is the fill-in input box, save it... + } else if (columnFillInChoice && choiceNumber === (totalChoices - 1)) { + fillinInput = $(this).find("td"); + // ...else push into the columnOptions array. + } else { + columnOptions.push($(this).find("td")); + } + }); + + // If randomize is true, randomly sort the options + if (opt.randomize) { + columnOptions.sort(utils.randOrd); + } + + //Create a new choices table to hold the arranged choices. + var newChoiceTable = $("
"); + + //Iterate over all available choices placing them in the correct position in the new choices table. + for (var i = 0; i < columnOptions.length; i++) { + // If we've already got perRow columnOptions in the row, close off the row + if ((i + 1) % opt.perRow === 0) { + newChoiceTable.append(""); + } + newChoiceTable.append(columnOptions[i]); + } + + //Insert fillInChoices section under available choices. + if (columnFillInChoice) { + var fillInRow = $("
"); + fillInRow.find("tr").append(fillinPrompt); + fillInRow.find("tr").append(fillinInput); + newChoiceTable.append(fillInRow); + } + + //Insert new table before the old choice table so that choices will still line up with header. + var choiceTable = $(thisFormField).find("table:first"); + choiceTable.before(newChoiceTable); + + //Choices table is not removed because validation depends on the table id. + choiceTable.hide(); + + }); + + }; // End $.fn.SPServices.SPArrangeChoices + + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + utils +) { + + "use strict"; + + // Provide suggested values from a list for in input column based on characters typed + $.fn.SPServices.SPAutocomplete = function (options) { + + var opt = $.extend({}, { + webURL: "", // [Optional] The name of the Web (site) which contains the sourceList + sourceList: "", // The name of the list which contains the values + sourceColumn: "", // The static name of the column which contains the values + columnName: "", // The display name of the column in the form + listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context. + CAMLQuery: "", // [Optional] For power users, this CAML fragment will be Anded with the default query on the relatedList + CAMLQueryOptions: "", // [Optional] For power users, allows specifying the CAMLQueryOptions for the GetListItems call + CAMLRowLimit: 0, // [Optional] Override the default view rowlimit and get all appropriate rows + filterType: "BeginsWith", // Type of filtering: [BeginsWith, Contains] + numChars: 0, // Wait until this number of characters has been typed before attempting any actions + ignoreCase: false, // If set to true, the function ignores case, if false it looks for an exact match + highlightClass: "", // If a class is supplied, highlight the matched characters in the values by applying that class to a wrapping span + uniqueVals: false, // If set to true, the function only adds unique values to the list (no duplicates) + maxHeight: 99999, // Sets the maximum number of values to display before scrolling occurs + slideDownSpeed: "fast", // Speed at which the div should slide down when values match (milliseconds or ["fast" | "slow"]) + processingIndicator: "_layouts/images/REFRESH.GIF", // If present, show this while processing + debug: false // If true, show error messages;if false, run silent + }, options); + + var matchNum; + + // Find the input control for the column and save some of its attributes + var columnObj = utils.findFormField(opt.columnName).find("input[Title^='" + opt.columnName + "']"); + columnObj.css("position", ""); + var columnObjColor = columnObj.css("color"); + var columnObjWidth = columnObj.css("width"); + + if (columnObj.html() === null && opt.debug) { + utils.errBox("SPServices.SPAutocomplete", + "columnName: " + opt.columnName, + "Column is not an input control or is not found on page"); + return; + } + + // Remove the
which isn't needed and messes up the formatting + columnObj.closest("span").find("br").remove(); + columnObj.wrap("
"); + + // Create a div to contain the matching values and add it to the DOM + var containerId = utils.genContainerId("SPAutocomplete", opt.columnName, opt.listName); + columnObj.after("
"); + + // Set the width to match the width of the input control + var containerObj = $("#" + containerId); + containerObj.css("width", columnObjWidth); + + // Handle keypresses + $(columnObj).keyup(function () { + + // Get the column's value + var columnValue = $(this).val(); + + // Hide the container while we're working on it + containerObj.hide(); + + // Have enough characters been typed yet? + if (columnValue.length < opt.numChars) { + return false; + } + + // Show the the processingIndicator as a background image in the input element + columnObj.css({ + "background-image": "url(" + opt.processingIndicator + ")", + "background-position": "right", + "background-repeat": "no-repeat" + }); + + // Array to hold the matched values + var matchArray = []; + + // Build the appropriate CAMLQuery + var camlQuery = ""; + if (opt.CAMLQuery.length > 0) { + camlQuery += ""; + } + camlQuery += "<" + opt.filterType + ">" + columnValue + ""; + if (opt.CAMLQuery.length > 0) { + camlQuery += opt.CAMLQuery + ""; + } + camlQuery += ""; + + // Call GetListItems to find all of the potential values + $().SPServices({ + operation: "GetListItems", + async: false, + webURL: opt.WebURL, + listName: opt.sourceList, + CAMLQuery: camlQuery, + CAMLQueryOptions: opt.CAMLQueryOptions, + CAMLViewFields: "", + CAMLRowLimit: opt.CAMLRowLimit, + completefunc: function (xData) { + // Handle upper/lower case if ignoreCase = true + var testValue = opt.ignoreCase ? columnValue.toUpperCase() : columnValue; + // See which values match and add the ones that do to matchArray + $(xData.responseXML).SPFilterNode("z:row").each(function () { + var thisValue = $(this).attr("ows_" + opt.sourceColumn); + var thisValueTest = opt.ignoreCase ? $(this).attr("ows_" + opt.sourceColumn).toUpperCase() : $(this).attr("ows_" + opt.sourceColumn); + // Make sure we have a match... + if (opt.filterType === "Contains") { + var firstMatch = thisValueTest.indexOf(testValue); + if ((firstMatch >= 0) && + // ...and that the match is not already in the array if we want uniqueness + (!opt.uniqueVals || ($.inArray(thisValue, matchArray) === -1))) { + matchArray.push($(this).attr("ows_" + opt.sourceColumn)); + } + } else { + // Handles normal case, which is BeginsWith and and other unknown values + if (testValue === thisValueTest.substr(0, testValue.length) && + // ...and that the match is not already in the array if we want uniqueness + (!opt.uniqueVals || ($.inArray(thisValue, matchArray) === -1))) { + matchArray.push($(this).attr("ows_" + opt.sourceColumn)); + } + } + }); + } + }); + + // Build out the set of list elements to contain the available values + var out = ""; + for (var i = 0; i < matchArray.length; i++) { + // If a highlightClass has been supplied, wrap a span around each match + if (opt.highlightClass.length > 0) { + // Set up Regex based on whether we want to ignore case + var thisRegex = new RegExp(columnValue, opt.ignoreCase ? "gi" : "g"); + // Look for all occurrences + var matches = matchArray[i].match(thisRegex); + var startLoc = 0; + // Loop for each occurrence, wrapping each in a span with the highlightClass CSS class + for (matchNum = 0; matchNum < matches.length; matchNum++) { + var thisPos = matchArray[i].indexOf(matches[matchNum], startLoc); + var endPos = thisPos + matches[matchNum].length; + var thisSpan = "" + matches[matchNum] + ""; + matchArray[i] = matchArray[i].substr(0, thisPos) + thisSpan + matchArray[i].substr(endPos); + startLoc = thisPos + thisSpan.length; + } + } + // Add the value to the markup for the container + out += "
  • " + matchArray[i] + "
  • "; + } + + // Add all the list elements to the containerId container + containerObj.html(out); + // Set up hehavior for the available values in the list element + $("#" + containerId + " li").click(function () { + $("#" + containerId).fadeOut(opt.slideUpSpeed); + columnObj.val($(this).text()); + }).mouseover(function () { + var mouseoverCss = { + "cursor": "hand", + "color": "#ffffff", + "background": "#3399ff" + }; + $(this).css(mouseoverCss); + }).mouseout(function () { + var mouseoutCss = { + "cursor": "inherit", + "color": columnObjColor, + "background": "transparent" + }; + $(this).css(mouseoutCss); + }); + + // If we've got some values to show, then show 'em! + if (matchArray.length > 0) { + $("#" + containerId).slideDown(opt.slideDownSpeed); + } + // Remove the processing indicator + columnObj.css("background-image", ""); + }); + + }; // End $.fn.SPServices.SPAutocomplete + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../utils/constants', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + // Function to set up cascading dropdowns on a SharePoint form + // (Newform.aspx, EditForm.aspx, or any other customized form.) + $.fn.SPServices.SPCascadeDropdowns = function (options) { + + var opt = $.extend({}, { + relationshipWebURL: "", // [Optional] The name of the Web (site) which contains the relationships list + relationshipList: "", // The name of the list which contains the parent/child relationships + relationshipListParentColumn: "", // The internal name of the parent column in the relationship list + relationshipListChildColumn: "", // The internal name of the child column in the relationship list + relationshipListSortColumn: "", // [Optional] If specified, sort the options in the dropdown by this column, + // otherwise the options are sorted by relationshipListChildColumn + parentColumn: "", // The display name of the parent column in the form + childColumn: "", // The display name of the child column in the form + listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context. + CAMLQuery: "", // [Optional] For power users, this CAML fragment will be Anded with the default query on the relationshipList + CAMLQueryOptions: "FALSE", // [Optional] For power users, ability to specify Query Options + promptText: "", // [DEPRECATED] Text to use as prompt. If included, {0} will be replaced with the value of childColumn. Original value "Choose {0}..." + noneText: "(None)", // [Optional] Text to use for the (None) selection. Provided for non-English language support. + simpleChild: false, // [Optional] If set to true and childColumn is a complex dropdown, convert it to a simple dropdown + selectSingleOption: false, // [Optional] If set to true and there is only a single child option, select it + matchOnId: false, // By default, we match on the lookup's text value. If matchOnId is true, we'll match on the lookup id instead. + completefunc: null, // Function to call on completion of rendering the change. + debug: false // If true, show error messages;if false, run silent + }, options); + + + var thisParentSetUp = false; + var thisFunction = "SPServices.SPCascadeDropdowns"; + + // Find the parent column's select (dropdown) + var parentSelect = $().SPServices.SPDropdownCtl({ + displayName: opt.parentColumn + }); + if (parentSelect.Obj.html() === null && opt.debug) { + utils.errBox(thisFunction, "parentColumn: " + opt.parentColumn, constants.TXTColumnNotFound); + return; + } + + // Find the child column's select (dropdown) + var childSelect = $().SPServices.SPDropdownCtl({ + displayName: opt.childColumn + }); + if (childSelect.Obj.html() === null && opt.debug) { + utils.errBox(thisFunction, "childColumn: " + opt.childColumn, constants.TXTColumnNotFound); + return; + } + + // If requested and the childColumn is a complex dropdown, convert to a simple dropdown + if (opt.simpleChild === true && childSelect.Type === constants.dropdownType.complex) { + $().SPServices.SPComplexToSimpleDropdown({ + listName: opt.listName, + columnName: opt.childColumn + }); + // Set the childSelect to reference the new simple dropdown + childSelect = $().SPServices.SPDropdownCtl({ + displayName: opt.childColumn + }); + } + + var childColumnRequired, childColumnStatic; + + // Get information about the childColumn from the current list + $().SPServices({ + operation: "GetList", + async: false, + cacheXML: true, + listName: opt.listName, + completefunc: function (xData) { + $(xData.responseXML).find("Fields").each(function () { + $(this).find("Field[DisplayName='" + opt.childColumn + "']").each(function () { + // Determine whether childColumn is Required + childColumnRequired = ($(this).attr("Required") === "TRUE"); + childColumnStatic = $(this).attr("StaticName"); + // Stop looking; we're done + return false; + }); + }); + } + }); + + // Save data about each child column on the parent + var childColumn = { + opt: opt, + childSelect: childSelect, + childColumnStatic: childColumnStatic, + childColumnRequired: childColumnRequired + }; + var childColumns = parentSelect.Obj.data("SPCascadeDropdownsChildColumns"); + + // If this is the first child for this parent, then create the data object to hold the settings + if (typeof childColumns === "undefined") { + parentSelect.Obj.data("SPCascadeDropdownsChildColumns", [childColumn]); + // If we already have a data object for this parent, then add the setting for this child to it + } else { + childColumns.push(childColumn); + parentSelect.Obj.data("SPCascadeDropdownsChildColumns", childColumns); + thisParentSetUp = true; + } + + // We only need to bind to the event(s) if we haven't already done so + if (!thisParentSetUp) { + switch (parentSelect.Type) { + // Plain old select + case constants.dropdownType.simple: + parentSelect.Obj.bind("change", function () { + cascadeDropdown(parentSelect); + }); + break; + // Input / Select hybrid + case constants.dropdownType.complex: + // Bind to any change on the hidden input element + parentSelect.optHid.bind("propertychange", function () { + cascadeDropdown(parentSelect); + }); + break; + // Multi-select hybrid + case constants.dropdownType.multiSelect: + // Handle the dblclick on the candidate select + $(parentSelect.master.candidateControl).bind("dblclick", function () { + cascadeDropdown(parentSelect); + }); + // Handle the dblclick on the selected values + $(parentSelect.master.resultControl).bind("dblclick", function () { + cascadeDropdown(parentSelect); + }); + // Handle button clicks + $(parentSelect.master.addControl).bind("click", function () { + cascadeDropdown(parentSelect); + }); + $(parentSelect.master.removeControl).bind("click", function () { + cascadeDropdown(parentSelect); + }); + break; + default: + break; + } + } + // Fire the change to set the initially allowable values + cascadeDropdown(parentSelect); + + }; // End $.fn.SPServices.SPCascadeDropdowns + + function cascadeDropdown(parentSelect) { + var choices = ""; + var parentSelectSelected; + var childSelectSelected = null; + var newMultiLookupPickerdata; + var numChildOptions; + var firstChildOptionId; + var firstChildOptionValue; + + // Filter each child column + var childColumns = parentSelect.Obj.data("SPCascadeDropdownsChildColumns"); + $(childColumns).each(function () { + + // Break out the data objects for this child column + var i; + var opt = this.opt; + var childSelect = this.childSelect; + var childColumnStatic = this.childColumnStatic; + var childColumnRequired = this.childColumnRequired; + + // Get the parent column selection(s) + parentSelectSelected = utils.getDropdownSelected(parentSelect, opt.matchOnId); + + // If the selection hasn't changed, then there's nothing to do right now. This is useful to reduce + // the number of Web Service calls when the parentSelect.Type = constants.dropdownType.complex or constants.dropdownType.multiSelect, as there are multiple propertychanges + // which don't require any action. The attribute will be unique per child column in case there are + // multiple children for a given parent. + var allParentSelections = parentSelectSelected.join(constants.spDelim); + if (parentSelect.Obj.data("SPCascadeDropdown_Selected_" + childColumnStatic) === allParentSelections) { + return; + } + parentSelect.Obj.data("SPCascadeDropdown_Selected_" + childColumnStatic, allParentSelections); + + // Get the current child column selection(s) + childSelectSelected = utils.getDropdownSelected(childSelect, true); + + // When the parent column's selected option changes, get the matching items from the relationship list + // Get the list items which match the current selection + var sortColumn = (opt.relationshipListSortColumn.length > 0) ? opt.relationshipListSortColumn : opt.relationshipListChildColumn; + var camlQuery = ""; + if (opt.CAMLQuery.length > 0) { + camlQuery += ""; + } + + // Build up the criteria for inclusion + if (parentSelectSelected.length === 0) { + // Handle the case where no values are selected in multi-selects + camlQuery += ""; + } else if (parentSelectSelected.length === 1) { + // Only one value is selected + camlQuery += "" : "'/>") + + utils.escapeColumnValue(parentSelectSelected[0]) + ""; + } else { + var compound = (parentSelectSelected.length > 2); + for (i = 0; i < (parentSelectSelected.length - 1); i++) { + camlQuery += ""; + } + for (i = 0; i < parentSelectSelected.length; i++) { + camlQuery += "" : "'/>") + + utils.escapeColumnValue(parentSelectSelected[i]) + ""; + if (i > 0 && (i < (parentSelectSelected.length - 1)) && compound) { + camlQuery += ""; + } + } + camlQuery += ""; + } + + if (opt.CAMLQuery.length > 0) { + camlQuery += opt.CAMLQuery + ""; + } + + // Make sure we don't get any items which don't have the child value + camlQuery += ""; + + camlQuery += ""; + + $().SPServices({ + operation: "GetListItems", + // Force sync so that we have the right values for the child column onchange trigger + async: false, + webURL: opt.relationshipWebURL, + listName: opt.relationshipList, + // Filter based on the currently selected parent column's value + CAMLQuery: camlQuery, + // Only get the parent and child columns + CAMLViewFields: "", + // Override the default view rowlimit and get all appropriate rows + CAMLRowLimit: 0, + // Even though setting IncludeMandatoryColumns to FALSE doesn't work as the docs describe, it fixes a bug in GetListItems with mandatory multi-selects + CAMLQueryOptions: opt.CAMLQueryOptions, + completefunc: function (xData) { + + // Handle errors + $(xData.responseXML).find("errorstring").each(function () { + var thisFunction = "SPServices.SPCascadeDropdowns"; + var errorText = $(this).text(); + if (opt.debug && errorText === "One or more field types are not installed properly. Go to the list settings page to delete these fields.") { + utils.errBox(thisFunction, + "relationshipListParentColumn: " + opt.relationshipListParentColumn + " or " + + "relationshipListChildColumn: " + opt.relationshipListChildColumn, + "Not found in relationshipList " + opt.relationshipList); + } else if (opt.debug && errorText === "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).") { + utils.errBox(thisFunction, + "relationshipList: " + opt.relationshipList, + "List not found"); + } + + }); + + // Add an explanatory prompt + switch (childSelect.Type) { + case constants.dropdownType.simple: + // Remove all of the existing options + childSelect.Obj[0].innerHTML = ""; +// $(childSelect.Obj).find("option").remove(); + // If the column is required or the promptText option is empty, don't add the prompt text + if (!childColumnRequired && (opt.promptText.length > 0)) { + childSelect.Obj.append(""); + } else if (!childColumnRequired) { + childSelect.Obj.append(""); + } + break; + case constants.dropdownType.complex: + // If the column is required, don't add the "(None)" option + choices = childColumnRequired ? "" : opt.noneText + "|0"; + childSelect.Obj.val(""); + break; + case constants.dropdownType.multiSelect: + // Remove all of the existing options + $(childSelect.master.candidateControl).find("option").remove(); + newMultiLookupPickerdata = ""; + break; + default: + break; + } + // Get the count of items returned and save it so that we can select if it's a single option + // The item count is stored thus: + numChildOptions = parseFloat($(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount")); + + // Add an option for each child item + $(xData.responseXML).SPFilterNode("z:row").each(function () { + + var thisOption = {}; + + // If relationshipListChildColumn is a Lookup column, then the ID should be for the Lookup value, + // else the ID of the relationshipList item + var thisValue = $(this).attr("ows_" + opt.relationshipListChildColumn); + + if (typeof thisValue !== "undefined" && thisValue.indexOf(constants.spDelim) > 0) { + thisOption = new utils.SplitIndex(thisValue); + } else { + thisOption.id = $(this).attr("ows_ID"); + thisOption.value = thisValue; + } + + // If the relationshipListChildColumn is a calculated column, then the value isn't preceded by the ID, + // but by the datatype. In this case, thisOption.id should be the ID of the relationshipList item. + // e.g., float;#12345.67 + if (isNaN(thisOption.id)) { + thisOption.id = $(this).attr("ows_ID"); + } + + // Save the id and value for the first child option in case we need to select it (selectSingleOption option is true) + firstChildOptionId = thisOption.id; + firstChildOptionValue = thisOption.value; + + switch (childSelect.Type) { + case constants.dropdownType.simple: + var selected = ($(this).attr("ows_ID") === childSelectSelected[0]) ? " selected='selected'" : ""; + childSelect.Obj.append("" + thisOption.value + ""); + break; + case constants.dropdownType.complex: + if (thisOption.id === childSelectSelected[0]) { + childSelect.Obj.val(thisOption.value); + } + choices = choices + ((choices.length > 0) ? "|" : "") + thisOption.value + "|" + thisOption.id; + break; + case constants.dropdownType.multiSelect: + $(childSelect.master.candidateControl).append(""); + newMultiLookupPickerdata += thisOption.id + "|t" + thisOption.value + "|t |t |t"; + break; + default: + break; + } + }); + + switch (childSelect.Type) { + case constants.dropdownType.simple: + childSelect.Obj.trigger("change"); + // If there is only one option and the selectSingleOption option is true, then select it + if (numChildOptions === 1 && opt.selectSingleOption === true) { + $(childSelect.Obj).find("option[value!='0']:first").attr("selected", "selected"); + } + break; + case constants.dropdownType.complex: + // Set the allowable choices + childSelect.Obj.attr("choices", choices); + // If there is only one option and the selectSingleOption option is true, then select it + if (numChildOptions === 1 && opt.selectSingleOption === true) { + // Set the input element value + $(childSelect.Obj).val(firstChildOptionValue); + // Set the value of the optHid input element + childSelect.optHid.val(firstChildOptionId); + } + // If there's no selection, then remove the value in the associated hidden input element (optHid) + if (childSelect.Obj.val() === "") { + childSelect.optHid.val(""); + } + break; + case constants.dropdownType.multiSelect: + // Clear the master + childSelect.master.data = ""; + childSelect.MultiLookupPickerdata.val(newMultiLookupPickerdata); + + // Clear any prior selections that are no longer valid or aren't selected + $(childSelect.master.resultControl).find("option").each(function () { + var thisSelected = $(this); + thisSelected.prop("selected", true); + $(childSelect.master.candidateControl).find("option[value='" + thisSelected.val() + "']").each(function () { + thisSelected.prop("selected", false); + }); + }); + GipRemoveSelectedItems(childSelect.master); + + // Hide any options in the candidate list which are already selected + $(childSelect.master.candidateControl).find("option").each(function () { + var thisSelected = $(this); + $(childSelect.master.resultControl).find("option[value='" + thisSelected.val() + "']").each(function () { + thisSelected.remove(); + }); + }); + GipAddSelectedItems(childSelect.master); + + // Set master.data to the newly allowable values + childSelect.master.data = GipGetGroupData(newMultiLookupPickerdata); + + // Trigger a dblclick so that the child will be cascaded if it is a multiselect. + $(childSelect.master.candidateControl).trigger("dblclick"); + + break; + default: + break; + } + } + }); + // If present, call completefunc when all else is done + if (opt.completefunc !== null) { + opt.completefunc(); + } + }); // $(childColumns).each(function() + + } // End cascadeDropdown + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + "../utils/constants", + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + // function to convert complex dropdowns to simple dropdowns + $.fn.SPServices.SPComplexToSimpleDropdown = function (options) { + + var opt = $.extend({}, { + listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context. + columnName: "", // The display name of the column in the form + completefunc: null, // Function to call on completion of rendering the change. + debug: false // If true, show error messages;if false, run silent + }, options); + + // Find the column's select (dropdown) + var columnSelect = $().SPServices.SPDropdownCtl({ + displayName: opt.columnName + }); + if (columnSelect.Obj.html() === null && opt.debug) { + utils.errBox("SPServices.SPComplexToSimpleDropdown", "columnName: " + opt.columnName, constants.TXTColumnNotFound); + return; + } + + // If we don't have a complex dropdown, then there is nothing to do + if (columnSelect.Type !== constants.dropdownType.complex) { + return; + } + + // The available options are stored in the choices attribute of the complex dropdown's input element... + var choices = $(columnSelect.Obj).attr("choices").split("|"); + + // We need to know which option is selected already, if any + var complexSelectSelectedId = columnSelect.optHid.val(); + + // Build up the simple dropdown, giving it an easy to select id + var simpleSelectId = utils.genContainerId("SPComplexToSimpleDropdown", columnSelect.Obj.attr("title"), opt.listName); + + var simpleSelect = ""; + + // Append the new simple select to the form + columnSelect.Obj.closest("td").prepend(simpleSelect); + var simpleSelectObj = $("#" + simpleSelectId); + + // Remove the complex dropdown functionality since we don't need it anymore... + columnSelect.Obj.closest("span").find("img").remove(); + // ...and hide the input element + columnSelect.Obj.closest("span").find("input").hide(); + + // When the simple select changes... + simpleSelectObj.change(function () { + var thisVal = $(this).val(); + // ...set the optHid input element's value to the valus of the selected option... + columnSelect.optHid.val(thisVal); + // ...and save the selected value as the hidden input's value only if the value is not equal to "0" (None) + $(columnSelect.Obj).val($(this).find("option[value='" + (thisVal !== "0" ? thisVal : "") + "']").html()); + }); + // Trigger a change to ensure that the selected value registers in the complex dropdown + simpleSelectObj.trigger("change"); + + // If present, call completefunc when all else is done + if (opt.completefunc !== null) { + opt.completefunc(); + } + + }; // End $.fn.SPServices.SPConvertToSimpleDropdown + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + "../utils/constants", + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + // Function to display related information when an option is selected on a form. + $.fn.SPServices.SPDisplayRelatedInfo = function (options) { + + var opt = $.extend({}, { + listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context. + columnName: "", // The display name of the column in the form + relatedWebURL: "", // [Optional] The name of the Web (site) which contains the related list + relatedList: "", // The name of the list which contains the additional information + relatedListColumn: "", // The internal name of the related column in the related list + relatedColumns: [], // An array of related columns to display + displayFormat: "table", // The format to use in displaying the related information. Possible values are: [table, list, none] + headerCSSClass: "ms-vh2", // CSS class for the table headers + rowCSSClass: "ms-vb", // CSS class for the table rows + CAMLQuery: "", // [Optional] For power users, this CAML fragment will be ed with the default query on the relatedList + numChars: 0, // If used on an input column (not a dropdown), no matching will occur until at least this number of characters has been entered + matchType: "Eq", // If used on an input column (not a dropdown), type of match. Can be any valid CAML comparison operator, most often "Eq" or "BeginsWith" + matchOnId: false, // By default, we match on the lookup's text value. If matchOnId is true, we'll match on the lookup id instead. + completefunc: null, // Function to call on completion of rendering the change. + debug: false // If true, show error messages;if false, run silent + }, options); + + var i; + var relatedColumnsXML = []; + var relatedListXML; + var thisFunction = "SPServices.SPDisplayRelatedInfo"; + + // Find the column's select (dropdown) + var columnSelect = $().SPServices.SPDropdownCtl({ + displayName: opt.columnName + }); + if (columnSelect.Obj.html() === null && opt.debug) { + utils.errBox(thisFunction, "columnName: " + opt.columnName, constants.TXTColumnNotFound); + return; + } + + // Get information about the related list and its columns + $().SPServices({ + operation: "GetList", + async: false, + cacheXML: true, + webURL: opt.relatedWebURL, + listName: opt.relatedList, + completefunc: function (xData) { + // If debug is on, notify about an error + $(xData.responseXML).find("faultcode").each(function () { + if (opt.debug) { + utils.errBox(thisFunction, "relatedList: " + opt.relatedList, "List not found"); + + } + }); + // Get info about the related list + relatedListXML = $(xData.responseXML).find("List"); + // Save the information about each column requested + for (i = 0; i < opt.relatedColumns.length; i++) { + relatedColumnsXML[opt.relatedColumns[i]] = $(xData.responseXML).find("Fields > Field[Name='" + opt.relatedColumns[i] + "']"); + } + relatedColumnsXML[opt.relatedListColumn] = $(xData.responseXML).find("Fields > Field[Name='" + opt.relatedListColumn + "']"); + } + }); + + switch (columnSelect.Type) { + // Plain old select + case constants.dropdownType.simple: + columnSelect.Obj.bind("change", function () { + showRelated(opt, relatedListXML, relatedColumnsXML); + }); + break; + // Input / Select hybrid + case constants.dropdownType.complex: + // Bind to any change on the hidden input element + columnSelect.optHid.bind("propertychange", function () { + showRelated(opt, relatedListXML, relatedColumnsXML); + }); + break; + // Multi-select hybrid + case constants.dropdownType.multiSelect: + if (opt.debug) { + utils.errBox(thisFunction, "columnName: " + opt.columnName, "Multi-select columns not supported by this function"); + } + break; + default: + break; + } + // Fire the change to set the initially allowable values + showRelated(opt, relatedListXML, relatedColumnsXML); + + }; // End $.fn.SPServices.SPDisplayRelatedInfo + + function showRelated(opt, relatedListXML, relatedColumnsXML) { + + var i; + var columnSelectSelected; + var thisFunction = "SPServices.SPDisplayRelatedInfo"; + + // Find the column's select (dropdown) + var columnSelect = $().SPServices.SPDropdownCtl({ + displayName: opt.columnName + }); + + // Get the current column selection(s) + columnSelectSelected = utils.getDropdownSelected(columnSelect, opt.matchOnId); + if (columnSelect.Type === constants.dropdownType.complex && opt.numChars > 0 && columnSelectSelected[0].length < opt.numChars) { + return; + } + + // If the selection hasn't changed, then there's nothing to do right now. This is useful to reduce + // the number of Web Service calls when the parentSelect.Type = constants.dropdownType.complex, as there are multiple propertychanges + // which don't require any action. + if (columnSelect.Obj.attr("showRelatedSelected") === columnSelectSelected[0]) { + return; + } + columnSelect.Obj.attr("showRelatedSelected", columnSelectSelected[0]); + + if(opt.displayFormat !== "none") { + // Generate a unique id for the container + var divId = utils.genContainerId("SPDisplayRelatedInfo", opt.columnName, opt.listName); + // Remove the old container... + $("#" + divId).remove(); + // ...and append a new, empty one + columnSelect.Obj.parent().append("
    "); + } + + // Get the list items which match the current selection + var camlQuery = ""; + if (opt.CAMLQuery.length > 0) { + camlQuery += ""; + } + + // Need to handle Lookup columns differently than static columns + var relatedListColumnType = relatedColumnsXML[opt.relatedListColumn].attr("Type"); + if (relatedListColumnType === "Lookup") { + camlQuery += "" : "'/>") + + utils.escapeColumnValue(columnSelectSelected[0]) + ""; + } else { + camlQuery += "" : opt.relatedListColumn + "'/>") + + utils.escapeColumnValue(columnSelectSelected[0]) + ""; + } + + if (opt.CAMLQuery.length > 0) { + camlQuery += opt.CAMLQuery + ""; + } + camlQuery += ""; + + var viewFields = " "; + for (i = 0; i < opt.relatedColumns.length; i++) { + viewFields += ""; + } + + $().SPServices({ + operation: "GetListItems", + async: false, + webURL: opt.relatedWebURL, + listName: opt.relatedList, + // Filter based on the column's currently selected value + CAMLQuery: camlQuery, + CAMLViewFields: "" + viewFields + "", + // Override the default view rowlimit and get all appropriate rows + CAMLRowLimit: 0, + completefunc: function (xData) { + + // Handle errors + $(xData.responseXML).find("errorstring").each(function () { + var errorText = $(this).text(); + if (opt.debug && errorText === "One or more field types are not installed properly. Go to the list settings page to delete these fields.") { + utils.errBox(thisFunction, + "relatedListColumn: " + opt.relatedListColumn, + "Column not found in relatedList " + opt.relatedList); + } else if (opt.debug && errorText === "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).") { + utils.errBox(thisFunction, + "relatedList: " + opt.relatedList, + "List not found"); + } + + }); + + var outString; + // Output each row + switch (opt.displayFormat) { + // Only implementing the table format in the first iteration (v0.2.9) + case "table": + outString = ""; + outString += ""; + for (i = 0; i < opt.relatedColumns.length; i++) { + if (typeof relatedColumnsXML[opt.relatedColumns[i]] === "undefined" && opt.debug) { + utils.errBox(thisFunction, "columnName: " + opt.relatedColumns[i], "Column not found in relatedList"); + return; + } + outString += ""; + } + outString += ""; + // Add an option for each child item + $(xData.responseXML).SPFilterNode("z:row").each(function () { + outString += ""; + for (i = 0; i < opt.relatedColumns.length; i++) { + outString += ""; + } + outString += ""; + }); + outString += "
    " + relatedColumnsXML[opt.relatedColumns[i]].attr("DisplayName") + "
    " + showColumn(relatedListXML, relatedColumnsXML[opt.relatedColumns[i]], $(this).attr("ows_" + opt.relatedColumns[i]), opt) + "
    "; + break; + // list format implemented in v0.5.0. Still table-based, but vertical orientation. + case "list": + outString = ""; + $(xData.responseXML).SPFilterNode("z:row").each(function () { + for (i = 0; i < opt.relatedColumns.length; i++) { + if (typeof relatedColumnsXML[opt.relatedColumns[i]] === "undefined" && opt.debug) { + utils.errBox(thisFunction, "columnName: " + opt.relatedColumns[i], "Column not found in relatedList"); + return; + } + outString += ""; + outString += ""; + outString += ""; + outString += ""; + } + }); + outString += "
    " + relatedColumnsXML[opt.relatedColumns[i]].attr("DisplayName") + "" + showColumn(relatedListXML, relatedColumnsXML[opt.relatedColumns[i]], $(this).attr("ows_" + opt.relatedColumns[i]), opt) + "
    "; + break; + case "none": + break; + default: + break; + } + // Write out the results + if(opt.displayFormat !== "none") { + $("#" + divId).html(outString); + } + + // If present, call completefunc when all else is done + if (opt.completefunc !== null) { + opt.completefunc(xData); + } + + } + }); + } // End showRelated + + // Display a column (field) formatted correctly based on its definition in the list. + // NOTE: Currently not dealing with locale differences. + // columnXML The XML node for the column from a GetList operation + // columnValue The text representation of the column's value + // opt The current set of options + function showColumn(listXML, columnXML, columnValue, opt) { + + if (typeof columnValue === "undefined") { + return ""; + } + + var i; + var outString = ""; + var fileName = ""; + var dispUrl; + var numDecimals; + var outArray = []; + var webUrl = opt.relatedWebURL.length > 0 ? opt.relatedWebURL : $().SPServices.SPGetCurrentSite(); + + + + + + + + switch (columnXML.attr("Type")) { + case "Text": + outString = columnValue; + break; + case "URL": + switch (columnXML.attr("Format")) { + // URL as hyperlink + case "Hyperlink": + outString = "" + + columnValue.substring(columnValue.search(",") + 1) + ""; + break; + // URL as image + case "Image": + outString = "" + columnValue.substring(columnValue.search(",") + 1) +
+                            ""; + break; + // Just in case + default: + outString = columnValue; + break; + } + break; + case "User": + case "UserMulti": + var userMultiValues = columnValue.split(constants.spDelim); + for (i = 0; i < userMultiValues.length; i = i + 2) { + outArray.push("" + + userMultiValues[i + 1] + ""); + } + outString = outArray.join(", "); + break; + case "Calculated": + var calcColumn = columnValue.split(constants.spDelim); + outString = calcColumn[1]; + break; + case "Number": + numDecimals = columnXML.attr("Decimals"); + outString = typeof numDecimals === "undefined" ? + parseFloat(columnValue).toString() : + parseFloat(columnValue).toFixed(numDecimals).toString(); + break; + case "Currency": + numDecimals = columnXML.attr("Decimals"); + outString = typeof numDecimals === "undefined" ? + parseFloat(columnValue).toFixed(2).toString() : + parseFloat(columnValue).toFixed(numDecimals).toString(); + break; + case "Lookup": + switch (columnXML.attr("Name")) { + case "FileRef": + // Get the display form URL for the lookup source list + dispUrl = listXML.attr("BaseType") === "1" ? listXML.attr("RootFolder") + constants.SLASH + "Forms/DispForm.aspx" : + listXML.attr("RootFolder") + constants.SLASH + "DispForm.aspx"; + outString = "" + + columnValue.substring(columnValue.search(constants.spDelim) + 2) + ""; + break; + case "FileDirRef": + // Get the display form URL for the lookup source list + dispUrl = constants.SLASH + columnValue.substring(columnValue.search(constants.spDelim) + 2); + outString = "" + + columnValue.substring(columnValue.search(constants.spDelim) + 2) + ""; + break; + // Any other lookup column + default: + // Get the display form URL for the lookup source list + dispUrl = utils.getListFormUrl(columnXML.attr("List"), "DisplayForm"); + outString = "" + + columnValue.substring(columnValue.search(constants.spDelim) + 2) + ""; + break; + } + break; + case "LookupMulti": + // Get the display form URL for the lookup source list + dispUrl = utils.getListFormUrl(columnXML.attr("List"), "DisplayForm"); + // Show all the values as links to the items, separated by commas + outString = ""; + if (columnValue.length > 0) { + var lookupMultiValues = columnValue.split(constants.spDelim); + for (i = 0; i < lookupMultiValues.length / 2; i++) { + outArray.push("" + + lookupMultiValues[(i * 2) + 1] + ""); + } + } + outString = outArray.join(", "); + break; + case "File": + fileName = columnValue.substring(columnValue.search(constants.spDelim) + 2); + outString = "" + fileName + ""; + break; + case "Counter": + outString = columnValue; + break; + case "DateTime": + outString = columnValue; + break; + default: + outString = columnValue; + break; + } + return outString; + } // End of function showColumn + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + "../utils/constants", + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + /* jshint undef: true */ + /* global GipAddSelectedItems, GipRemoveSelectedItems, GipGetGroupData */ + + // Function to filter a lookup based dropdown + $.fn.SPServices.SPFilterDropdown = function (options) { + + var opt = $.extend({}, { + relationshipWebURL: "", // [Optional] The name of the Web (site) which contains the relationshipList + relationshipList: "", // The name of the list which contains the lookup values + relationshipListColumn: "", // The internal name of the column in the relationship list + relationshipListSortColumn: "", // [Optional] If specified, sort the options in the dropdown by this column, + // otherwise the options are sorted by relationshipListColumn + relationshipListSortAscending: true, // [Optional] By default, the sort is ascending. If false, descending + columnName: "", // The display name of the column in the form + listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context. + promptText: "", // [DEPRECATED] Text to use as prompt. If included, {0} will be replaced with the value of columnName. IOrignal value "Choose {0}..." + noneText: "(None)", // [Optional] Text to use for the (None) selection. Provided for non-English language support. + CAMLQuery: "", // This CAML fragment will be applied to the relationshipList + CAMLQueryOptions: "FALSE", // Need this to mirror SharePoint's behavior, but it can be overridden + completefunc: null, // Function to call on completion of rendering the change. + debug: false // If true, show error messages; if false, run silent + }, options); + + var choices = ""; + var columnSelectSelected = null; + var newMultiLookupPickerdata; + var columnColumnRequired; + var thisFunction = "SPServices.SPFilterDropdown"; + + // Find the column's select (dropdown) + var columnSelect = $().SPServices.SPDropdownCtl({ + displayName: opt.columnName + }); + if (columnSelect.Obj.html() === null && opt.debug) { + utils.errBox(thisFunction, "columnName: " + opt.columnName, constants.TXTColumnNotFound); + return; + } + + // Get the current column selection(s) + columnSelectSelected = utils.getDropdownSelected(columnSelect, true); + + // Get the relationshipList items which match the current selection + var sortColumn = (opt.relationshipListSortColumn.length > 0) ? opt.relationshipListSortColumn : opt.relationshipListColumn; + var sortOrder = (opt.relationshipListSortAscending === true) ? "" : "Ascending='FALSE'"; + var camlQuery = ""; + if (opt.CAMLQuery.length > 0) { + camlQuery += opt.CAMLQuery; + } + camlQuery += ""; + + // Get information about columnName from the current list + $().SPServices({ + operation: "GetList", + async: false, + cacheXML: true, + listName: opt.listName, + completefunc: function (xData) { + $(xData.responseXML).find("Fields").each(function () { + $(this).find("Field[DisplayName='" + opt.columnName + "']").each(function () { + // Determine whether columnName is Required + columnColumnRequired = ($(this).attr("Required") === "TRUE"); + // Stop looking; we're done + return false; + }); + }); + } + }); + + $().SPServices({ + operation: "GetListItems", + // Force sync so that we have the right values for the column onchange trigger + async: false, + webURL: opt.relationshipWebURL, + listName: opt.relationshipList, + // Filter based on the specified CAML + CAMLQuery: camlQuery, + // Only get the columnName's data (plus columns we can't prevent) + CAMLViewFields: "", + // Override the default view rowlimit and get all appropriate rows + CAMLRowLimit: 0, + // Even though setting IncludeMandatoryColumns to FALSE doesn't work as the docs describe, it fixes a bug in GetListItems with mandatory multi-selects + CAMLQueryOptions: opt.CAMLQueryOptions, + completefunc: function (xData) { + + // Handle errors + $(xData.responseXML).find("errorstring").each(function () { + var errorText = $(this).text(); + if (opt.debug && errorText === "One or more field types are not installed properly. Go to the list settings page to delete these fields.") { + utils.errBox(thisFunction, + "relationshipListColumn: " + opt.relationshipListColumn, + "Not found in relationshipList " + opt.relationshipList); + } else if (opt.debug && errorText === "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).") { + utils.errBox(thisFunction, + "relationshipList: " + opt.relationshipList, + "List not found"); + } + + }); + + // Add an explanatory prompt + switch (columnSelect.Type) { + case constants.dropdownType.simple: + // Remove all of the existing options + $(columnSelect.Obj).find("option").remove(); + // If the column is required or the promptText option is empty, don't add the prompt text + if (!columnColumnRequired && (opt.promptText.length > 0)) { + columnSelect.Obj.append(""); + } else if (!columnColumnRequired) { + columnSelect.Obj.append(""); + } + break; + case constants.dropdownType.complex: + // If the column is required, don't add the "(None)" option + choices = columnColumnRequired ? "" : opt.noneText + "|0"; + columnSelect.Obj.val(""); + break; + case constants.dropdownType.multiSelect: + // Remove all of the existing options + $(columnSelect.master.candidateControl).find("option").remove(); + newMultiLookupPickerdata = ""; + break; + default: + break; + } + + // Add an option for each item + $(xData.responseXML).SPFilterNode("z:row").each(function () { + + var thisOption = {}; + + // If relationshipListColumn is a Lookup column, then the ID should be for the Lookup value, + // else the ID of the relationshipList item + var thisValue = $(this).attr("ows_" + opt.relationshipListColumn); + + if (typeof thisValue !== "undefined" && thisValue.indexOf(constants.spDelim) > 0) { + thisOption = new utils.SplitIndex(thisValue); + } else { + thisOption.id = $(this).attr("ows_ID"); + thisOption.value = thisValue; + } + + // If the relationshipListColumn is a calculated column, then the value isn't preceded by the ID, + // but by the datatype. In this case, thisOption.id should be the ID of the relationshipList item. + // e.g., float;#12345.67 + if (isNaN(thisOption.id)) { + thisOption.id = $(this).attr("ows_ID"); + } + + switch (columnSelect.Type) { + case constants.dropdownType.simple: + var selected = ($(this).attr("ows_ID") === columnSelectSelected[0]) ? " selected='selected'" : ""; + columnSelect.Obj.append("" + thisOption.value + ""); + break; + case constants.dropdownType.complex: + if (thisOption.id === columnSelectSelected[0]) { + columnSelect.Obj.val(thisOption.value); + } + choices = choices + ((choices.length > 0) ? "|" : "") + thisOption.value + "|" + thisOption.id; + break; + case constants.dropdownType.multiSelect: + $(columnSelect.master.candidateControl).append(""); + newMultiLookupPickerdata += thisOption.id + "|t" + thisOption.value + "|t |t |t"; + break; + default: + break; + } + }); + + switch (columnSelect.Type) { + case constants.dropdownType.simple: + columnSelect.Obj.trigger("change"); + break; + case constants.dropdownType.complex: + columnSelect.Obj.attr("choices", choices); + columnSelect.Obj.trigger("propertychange"); + break; + case constants.dropdownType.multiSelect: + // Clear the master + columnSelect.master.data = ""; + + columnSelect.MultiLookupPickerdata.val(newMultiLookupPickerdata); + // Clear any prior selections that are no longer valid + $(columnSelect.master.resultControl).find("option").each(function () { + var thisSelected = $(this); + $(this).attr("selected", "selected"); + $(columnSelect.master.candidateControl).find("option").each(function () { + if ($(this).html() === thisSelected.html()) { + thisSelected.removeAttr("selected"); + } + }); + }); + GipRemoveSelectedItems(columnSelect.master); + // Hide any options in the candidate list which are already selected + $(columnSelect.master.candidateControl).find("option").each(function () { + var thisSelected = $(this); + $(columnSelect.master.resultControl).find("option").each(function () { + if ($(this).html() === thisSelected.html()) { + thisSelected.remove(); + } + }); + }); + GipAddSelectedItems(columnSelect.master); + // Set master.data to the newly allowable values + columnSelect.master.data = GipGetGroupData(newMultiLookupPickerdata); + + // Trigger a dblclick so that the child will be cascaded if it is a multiselect. + $(columnSelect.master.candidateControl).trigger("dblclick"); + + break; + default: + break; + } + } + }); + // If present, call completefunc when all else is done + if (opt.completefunc !== null) { + opt.completefunc(); + } + }; // End $.fn.SPServices.SPFilterDropdown + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core.js' +], function ( + $ +) { + + "use strict"; + + // Find an MMS Picker in the page + // Returns references to: + // terms - The aaray of terms as value/guid pairs + $.fn.SPServices.SPFindMMSPicker = function (options) { + + var opt = $.extend({}, { + MMSDisplayName: "" // The displayName of the MMS Picker on the form + }, options); + + var thisTerms = []; + + // Find the div for the column which contains the entered data values + var thisDiv = $("div[title='" + opt.MMSDisplayName + "']"); + var thisHiddenInput = thisDiv.closest("td").find("input[type='hidden']"); + var thisTermArray = thisHiddenInput.val().split(";"); + + for (var i = 0; i < thisTermArray.length; i++) { + var thisOne = thisTermArray[i].split("|"); + thisTerms.push({ + value: thisOne[0], + guid: thisOne[1] + }); + + } + + return { + terms: thisTerms + }; + + }; // End $.fn.SPServices.SPFindMMSPicker + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core.js' +], function ( + $ +) { + + "use strict"; + + // Find a People Picker in the page + // Returns references to: + // row - The TR which contains the People Picker (useful if you'd like to hide it at some point) + // contents - The element which contains the current value + // currentValue - The current value if it is set + // checkNames - The Check Names image (in case you'd like to click it at some point) + // checkNamesPhrase - you can pass your local phrase here to check names, like in russian it would be - ????????? ????? + $.fn.SPServices.SPFindPeoplePicker = function (options) { + + var opt = $.extend({}, { + peoplePickerDisplayName: "", // The displayName of the People Picker on the form + valueToSet: "", // The value to set the People Picker to. Should be a string containing each username or groupname separated by semi-colons. + checkNames: true, // If set to true, the Check Names image will be clicked to resolve the names + checkNamesPhrase: 'Check Names' // English default + }, options); + + var thisRow = $("nobr").filter(function () { + // Ensures we get a match whether or not the People Picker is required (if required, the nobr contains a span also) + return $(this).contents().eq(0).text() === opt.peoplePickerDisplayName; + }).closest("tr"); + + var thisContents = thisRow.find("div[name='upLevelDiv']"); + var thisCheckNames = thisRow.find("img[Title='" + opt.checkNamesPhrase + "']:first"); + + // If a value was provided, set the value + if (opt.valueToSet.length > 0) { + thisContents.html(opt.valueToSet); + } + + // If checkName is true, click the check names icon + if (opt.checkNames) { + thisCheckNames.click(); + } + var thisCurrentValue = $.trim(thisContents.text()); + + // Parse the entity data + var dictionaryEntries = []; + + // IE + thisContents.children("span").each(function () { + + // Grab the entity data + var thisData = $(this).find("div[data]").attr("data"); + + var dictionaryEntry = {}; + + // Entity data is only available in IE + if (typeof thisData !== "undefined") { + var arrayOfDictionaryEntry = $.parseXML(thisData); + var $xml = $(arrayOfDictionaryEntry); + + $xml.find("DictionaryEntry").each(function () { + var key = $(this).find("Key").text(); + dictionaryEntry[key] = $(this).find("Value").text(); + }); + dictionaryEntries.push(dictionaryEntry); + // For other browsers, we'll call GetUserInfo to get the data + } else { + $().SPServices({ + operation: "GetUserInfo", + async: false, + cacheXML: true, + userLoginName: $(this).attr("title"), + completefunc: function (xData) { + + $(xData.responseXML).find("User").each(function () { + + $.each(this.attributes, function (i, attrib) { + dictionaryEntry[attrib.name] = attrib.value; + }); + dictionaryEntries.push(dictionaryEntry); + }); + } + }); + } + }); + + return { + row: thisRow, + contents: thisContents, + currentValue: thisCurrentValue, + checkNames: thisCheckNames, + dictionaryEntries: dictionaryEntries + }; + }; // End $.fn.SPServices.SPFindPeoplePicker + + // Mistakenly released previously outside the SPServices namespace. This takes care of offering both. + $.fn.SPFindPeoplePicker = function (options) { + return $().SPServices.SPFindPeoplePicker(options); + }; // End $.fn.SPFindPeoplePicker + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + "../utils/constants", + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + // Function which provides a link on a Lookup column for the user to follow + // which allows them to add a new value to the Lookup list. + // Based on http://blog.mastykarz.nl/extending-lookup-fields-add-new-item-option/ + // by Waldek Mastykarz + $.fn.SPServices.SPLookupAddNew = function (options) { + + var opt = $.extend({}, { + lookupColumn: "", // The display name of the Lookup column + promptText: "Add new {0}", // Text to use as prompt + column name + newWindow: false, // If true, the link will open in a new window *without* passing the Source. + ContentTypeID: "", // [Optional] Pass the ContentTypeID if you'd like to specify it + completefunc: null, // Function to call on completion of rendering the change. + debug: false // If true, show error messages;if false, run silent + }, options); + + var thisFunction = "SPServices.SPLookupAddNew"; + + // Find the lookup column's select (dropdown) + var lookupSelect = $().SPServices.SPDropdownCtl({ + displayName: opt.lookupColumn + }); + if (lookupSelect.Obj.html() === null && opt.debug) { + utils.errBox(thisFunction, "lookupColumn: " + opt.lookupColumn, constants.TXTColumnNotFound); + return; + } + + var newUrl = ""; + var lookupListUrl = ""; + var lookupColumnStaticName = ""; + // Use GetList for the current list to determine the details for the Lookup column + $().SPServices({ + operation: "GetList", + async: false, + cacheXML: true, + listName: $().SPServices.SPListNameFromUrl(), + completefunc: function (xData) { + $(xData.responseXML).find("Field[DisplayName='" + opt.lookupColumn + "']").each(function () { + lookupColumnStaticName = $(this).attr("StaticName"); + // Use GetList for the Lookup column's list to determine the list's URL + $().SPServices({ + operation: "GetList", + async: false, + cacheXML: true, + listName: $(this).attr("List"), + completefunc: function (xData) { + $(xData.responseXML).find("List").each(function () { + lookupListUrl = $(this).attr("WebFullUrl"); + // Need to handle when list is in the root site + lookupListUrl = lookupListUrl !== constants.SLASH ? lookupListUrl + constants.SLASH : lookupListUrl; + }); + } + }); + // Get the NewItem form for the Lookup column's list + newUrl = utils.getListFormUrl($(this).attr("List"), "NewForm"); + // Stop looking;we're done + return false; + }); + } + }); + + if (lookupListUrl.length === 0 && opt.debug) { + utils.errBox(thisFunction, "lookupColumn: " + opt.lookupColumn, "This column does not appear to be a lookup column"); + return; + } + if (newUrl.length > 0) { + // Build the link to the Lookup column's list enclosed in a div with the id="SPLookupAddNew_" + lookupColumnStaticName + var newHref = lookupListUrl + newUrl; + // If requested, open the link in a new window and if requested, pass the ContentTypeID + newHref += opt.newWindow ? + ((opt.ContentTypeID.length > 0) ? "?ContentTypeID=" + opt.ContentTypeID : "") + "' target='_blank'" : + "?" + ((opt.ContentTypeID.length > 0) ? "ContentTypeID=" + opt.ContentTypeID + "&" : "") + "Source=" + utils.escapeUrl(location.href) + "'"; + var newLink = "
    " + " 0) ? location.href.substring(0, location.href.indexOf("?")) : location.href; + // ... plus the Source if it exists + var thisSource = (typeof queryStringVals.Source === "string") ? + "Source=" + queryStringVals.Source.replace(/\//g, "%2f").replace(/:/g, "%3a") : ""; + + var newQS = []; + if (typeof QSList !== "undefined") { + newQS.push("List=" + QSList); + } + if (typeof QSRootFolder !== "undefined") { + newQS.push("RootFolder=" + QSRootFolder); + } + if (typeof QSContentTypeId !== "undefined") { + newQS.push("ContentTypeId=" + QSContentTypeId); + } + + var newAction = thisUrl + + ((newQS.length > 0) ? ("?" + newQS.join("&") + "&") : "?") + + // Set the Source to point back to this page with the lastID this user has added + "Source=" + thisUrl + + "?ID=" + lastID + + // Pass the original source as RealSource, if present + ((thisSource.length > 0) ? ("%26RealSource=" + queryStringVals.Source) : "") + + // Pass the override RedirectURL, if present + ((typeof queryStringVals.RedirectURL === "string") ? ("%26RedirectURL=" + queryStringVals.RedirectURL) : ""); + + // Set the new form action + setTimeout(function() { + document.forms.aspnetForm.action = newAction; + }, 0); + }); + // If this is the load after the item is saved, wait until the new item has been saved (commits are asynchronous), + // then do the redirect to redirectUrl with the new lastID, passing along the original Source. + } else { + while (queryStringVals.ID === lastID) { + lastID = $().SPServices.SPGetLastItemId({ + listName: thisList + }); + } + // If there is a RedirectURL parameter on the Query String, then redirect there instead of the value + // specified in the options (opt.redirectUrl) + var thisRedirectUrl = (typeof queryStringVals.RedirectURL === "string") ? queryStringVals.RedirectURL : opt.redirectUrl; + location.href = thisRedirectUrl + "?" + opt.qsParamName + "=" + lastID + + ((typeof queryStringVals.RealSource === "string") ? ("&Source=" + queryStringVals.RealSource) : ""); + } + }; // End $.fn.SPServices.SPRedirectWithID + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + utils +) { + + "use strict"; + + // Function which checks to see if the value for a column on the form is unique in the list. + $.fn.SPServices.SPRequireUnique = function (options) { + + var opt = $.extend({}, { + columnStaticName: "Title", // Name of the column + duplicateAction: 0, // 0 = warn, 1 = prevent + ignoreCase: false, // If set to true, the function ignores case, if false it looks for an exact match + initMsg: "This value must be unique.", // Initial message to display after setup + initMsgCSSClass: "ms-vb", // CSS class for initial message + errMsg: "This value is not unique.", // Error message to display if not unique + errMsgCSSClass: "ms-formvalidation", // CSS class for error message + showDupes: false, // If true, show links to the duplicate item(s) after the error message + completefunc: null // Function to call on completion of rendering the change. + }, options); + + // Get the current item's ID from the Query String + var queryStringVals = $().SPServices.SPGetQueryString(); + var thisID = queryStringVals.ID; + var thisList = $().SPServices.SPListNameFromUrl(); + + // Set the messages based on the options provided + var msg = "{1}
    "; + var firstMsg = msg.replace(/\{0\}/g, opt.initMsgCSSClass).replace(/\{1\}/g, opt.initMsg); + + // We need the DisplayName + var columnDisplayName = $().SPServices.SPGetDisplayFromStatic({ + listName: thisList, + columnStaticName: opt.columnStaticName + }); + var columnObj = utils.findFormField(columnDisplayName).find("input[Title^='" + columnDisplayName + "']"); + columnObj.parent().append(firstMsg); + + columnObj.blur(function () { + var columnValueIDs = []; + // Get the columnDisplayName's value + var columnValue = $(this).val(); + if (columnValue.length === 0) { + return false; + } + + // Call the Lists Web Service (GetListItems) to see if the value already exists + $().SPServices({ + operation: "GetListItems", + async: false, + listName: thisList, + // Make sure we get all the items, ignoring any filters on the default view. + CAMLQuery: "", + // Filter based on columnStaticName's value + CAMLViewFields: "", + // Override the default view rowlimit and get all appropriate rows + CAMLRowLimit: 0, + completefunc: function (xData) { + var testValue = opt.ignoreCase ? columnValue.toUpperCase() : columnValue; + $(xData.responseXML).SPFilterNode("z:row").each(function () { + var thisValue = opt.ignoreCase ? $(this).attr("ows_" + opt.columnStaticName).toUpperCase() : $(this).attr("ows_" + opt.columnStaticName); + // If this value already exists in columnStaticName and it's not the current item, then save the ID in the array + if ((testValue === thisValue) && ($(this).attr("ows_ID") !== thisID)) { + columnValueIDs.push([$(this).attr("ows_ID"), $(this).attr("ows_" + opt.columnStaticName)]); + } + }); + } + }); + var newMsg = opt.initMsg; + var msgContainer = $("#SPRequireUnique" + opt.columnStaticName); + msgContainer.html(newMsg).attr("class", opt.initMsgCSSClass); + + $("input[value='OK']:disabled, input[value='Save']:disabled").removeAttr("disabled"); + if (columnValueIDs.length > 0) { + newMsg = opt.errMsg; + msgContainer.html(newMsg).attr("class", opt.errMsgCSSClass); + if (opt.duplicateAction === 1) { + columnObj.focus(); + $("input[value='OK'], input[value='Save']").attr("disabled", "disabled"); + } + if (opt.showDupes) { + var out = " " + columnValueIDs.length + " duplicate item" + (columnValueIDs.length > 1 ? "s" : "") + ": "; + for (var i = 0; i < columnValueIDs.length; i++) { + out += "
    " + columnValueIDs[i][1] + " "; + } + $("span#SPRequireUnique" + opt.columnStaticName).append(out); + } + } + + }); + // If present, call completefunc when all else is done + if (opt.completefunc !== null) { + opt.completefunc(); + } + }; // End $.fn.SPServices.SPRequireUnique + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + "../utils/constants", + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + // Does an audit of a site's list forms to show where script is in use. + $.fn.SPServices.SPScriptAudit = function (options) { + + var opt = $.extend({}, { + webURL: "", // [Optional] The name of the Web (site) to audit + listName: "", // [Optional] The name of a specific list to audit. If not present, all lists in the site are audited. + outputId: "", // The id of the DOM object for output + auditForms: true, // Audit the form pages + auditViews: true, // Audit the view pages + auditPages: true, // Audit the Pages Document Library + auditPagesListName: "Pages", // The Pages Document Library(ies), if desired. Either a single string or an array of strings. + showHiddenLists: false, // Show output for hidden lists + showNoScript: false, // Show output for lists with no scripts (effectively "verbose") + showSrc: true // Show the source location for included scripts + }, options); + + var formTypes = [ + ["New", "NewForm.aspx", false], + ["Display", "DispForm.aspx", false], + ["Edit", "EditForm.aspx", false] + ]; + var listXml; + + // Build the table to contain the results + $("#" + opt.outputId) + .append("" + + "" + + "" + + "" + + "" + + "" + + "" + + (opt.showSrc ? "" : "") + + "" + + "
    ListPage ClassPage TypePageScript References
    "); + // Apply the CSS class to the headers + var scriptAuditContainer = $("#SPScriptAudit"); + scriptAuditContainer.find("th").attr("class", "ms-vh2-nofilter"); + + // Don't bother with the lists if the options don't require them + if (opt.auditForms || opt.auditViews) { + // First, get all of the lists within the site + $().SPServices({ + operation: "GetListCollection", + webURL: opt.webURL, + async: false, // Need this to be synchronous so we're assured of a valid value + completefunc: function (xData) { + $(xData.responseXML).find("List").each(function () { + listXml = $(this); + + // If listName has been specified, then only return results for that list + if ((opt.listName.length === 0) || (listXml.attr("Title") === opt.listName)) { + // Don't work with hidden lists unless we're asked to + if ((opt.showHiddenLists && listXml.attr("Hidden") === "False") || !opt.showHiddenLists) { + + // Audit the list's forms + if (opt.auditForms) { + // Get the list's Content Types, therefore the form pages + $().SPServices({ + operation: "GetListContentTypes", + webURL: opt.webURL, + listName: listXml.attr("ID"), + async: false, // Need this to be synchronous so we're assured of a valid value + completefunc: function (xData) { + $(xData.responseXML).find("ContentType").each(function () { + // Don't deal with folders + if ($(this).attr("ID").substring(0, 6) !== "0x0120") { + var formUrls = $(this).find("FormUrls"); + for (var i = 0; i < formTypes.length; i++) { + // Look for a customized form... + $(formUrls).find(formTypes[i][0]).each(function () { + SPScriptAuditPage(opt, listXml, "Form", this.nodeName, ((opt.webURL.length > 0) ? opt.webURL : $().SPServices.SPGetCurrentSite()) + constants.SLASH + $(this).text()); + formTypes[i][2] = true; + }); + // ...else the uncustomized form + if (!formTypes[i][2]) { + var defaultViewUrl = listXml.attr("DefaultViewUrl"); + SPScriptAuditPage(opt, listXml, "Form", formTypes[i][0], + defaultViewUrl.substring(0, defaultViewUrl.lastIndexOf(constants.SLASH) + 1) + formTypes[i][1]); + } + } + // Reset the form types + for (i = 0; i < formTypes.length; i++) { + formTypes[i][2] = false; + } + } + }); + } + }); + } + + // Audit the list's views + if (opt.auditViews) { + // Get the list's Views + $().SPServices({ + operation: "GetViewCollection", + webURL: opt.webURL, + listName: listXml.attr("ID"), + async: false, // Need this to be synchronous so we're assured of a valid value + completefunc: function (xData) { + $(xData.responseXML).find("View").each(function () { + SPScriptAuditPage(opt, listXml, "View", $(this).attr("DisplayName"), $(this).attr("Url")); + }); + } + }); + } + + } + } + }); + } + }); + } + + // Don't bother with auditing pages if the options don't require it + var numLists = 0; + var listsArray = []; + if (typeof opt.auditPagesListName === "string") { + numLists = 1; + listsArray.push(opt.auditPagesListName); + } else { + numLists = opt.auditPagesListName.length; + listsArray = opt.auditPagesListName; + } + + if (opt.auditPages) { + for (var i = 0; i < numLists; i++) { + $().SPServices({ + operation: "GetList", + async: false, + cacheXML: true, + webURL: opt.webURL, + listName: listsArray[i], + completefunc: function (xData) { + $(xData.responseXML).find("List").each(function () { + listXml = $(this); + }); + } + }); + // Get all of the items from the Document Library + $().SPServices({ + operation: "GetListItems", + async: false, + webURL: opt.webURL, + listName: listsArray[i], + CAMLQuery: "Folder", + CAMLViewFields: "", + CAMLRowLimit: 0, + completefunc: function (xData) { + $(xData.responseXML).SPFilterNode("z:row").each(function () { + var thisPageUrl = $(this).attr("ows_FileRef").split(constants.spDelim)[1]; + var thisTitle = $(this).attr("ows_Title"); + var thisPageType = (typeof thisTitle !== "undefined") ? thisTitle : ""; + if (thisPageUrl.indexOf(".aspx") > 0) { + SPScriptAuditPage(opt, listXml, "Page", thisPageType, constants.SLASH + thisPageUrl); + } + }); + } + }); + } + } + // Remove progress indicator and make the output pretty by cleaning up the ms-alternating CSS class + scriptAuditContainer.find("tr[class='ms-alternating']:even").removeAttr("class"); + }; // End $.fn.SPServices.SPScriptAudit + + // Displays the usage of scripts in a site + function SPScriptAuditPage(opt, listXml, pageClass, pageType, pageUrl) { + + var jQueryPage = 0; + var pageScriptSrc = {}; + pageScriptSrc.type = []; + pageScriptSrc.src = []; + pageScriptSrc.script = []; + var scriptRegex = RegExp("", "gi"); + + // Fetch the page + $.ajax({ + type: "GET", + url: pageUrl, + dataType: "text", + async: false, + success: function (xData) { + + var scriptMatch; + + while (scriptMatch = scriptRegex.exec(xData)) { + var scriptLanguage = getScriptAttribute(scriptMatch, "language"); + var scriptType = getScriptAttribute(scriptMatch, "type"); + var scriptSrc = getScriptAttribute(scriptMatch, "src"); + if (scriptSrc !== null && scriptSrc.length > 0 && !coreScript(scriptSrc)) { + pageScriptSrc.type.push((scriptLanguage !== null && scriptLanguage.length > 0) ? scriptLanguage : scriptType); + pageScriptSrc.src.push(scriptSrc); + jQueryPage++; + } + } + + // Only show pages without script if we've been asked to do so. + if ((!opt.showNoScript && (pageScriptSrc.type.length > 0)) || opt.showNoScript) { + var pagePath = pageUrl.substring(0, pageUrl.lastIndexOf(constants.SLASH) + 1); + var out = "" + + "" + + "" + listXml.attr("Title") + ((listXml.attr("Hidden") === "True") ? '(Hidden)' : '') + "" + + "" + pageClass + "" + + "" + pageType + "" + + "" + utils.fileName(pageUrl) + ""; + if (opt.showSrc) { + var thisSrcPath; + out += ""; + for (var i = 0; i < pageScriptSrc.type.length; i++) { + thisSrcPath = (pageScriptSrc.src[i].substr(0, 1) !== constants.SLASH) ? pagePath + pageScriptSrc.src[i] : pageScriptSrc.src[i]; + out += ""; + out += ""; + } + out += "
    " + pageScriptSrc.type[i] + "" + utils.fileName(pageScriptSrc.src[i]) + "
    "; + } + $("#SPScriptAudit").append(out); + } + } + }); + } // End of function SPScriptAuditPage + + function getScriptAttribute(source, attribute) { + var matches; + var regex = RegExp(attribute + "=(\"([^\"]*)\")|('([^']*)')", "gi"); + if (matches = regex.exec(source)) { + return matches[2]; + } + return null; + } // End of function getScriptAttribute + + // Check to see if the script reference is part of SharePoint core so that we can ignore it + function coreScript(src) { + var coreScriptLocations = ["WebResource.axd", "_layouts"]; + for (var i = 0; i < coreScriptLocations.length; i++) { + if (src.indexOf(coreScriptLocations[i]) > -1) { + return true; + } + } + return false; + } // End of function coreScript + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + "../utils/constants", + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + // The SPSetMultiSelectSizes function sets the sizes of the multi-select boxes for a column on a form automagically + // based on the values they contain. The function takes into account the fontSize, fontFamily, fontWeight, etc., in its algorithm. + $.fn.SPServices.SPSetMultiSelectSizes = function (options) { + + var opt = $.extend({}, { + listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context. + multiSelectColumn: "", + minWidth: 0, + maxWidth: 0, + debug: false + }, options); + + var thisFunction = "SPServices.SPSetMultiSelectSizes"; + + // Find the multi-select column + var thisMultiSelect = $().SPServices.SPDropdownCtl({ + displayName: opt.multiSelectColumn + }); + if (thisMultiSelect.Obj.html() === null && opt.debug) { + utils.errBox(thisFunction, "multiSelectColumn: " + opt.multiSelectColumn, constants.TXTColumnNotFound); + return; + } + if (thisMultiSelect.Type !== constants.dropdownType.multiSelect && opt.debug) { + utils.errBox(thisFunction, "multiSelectColumn: " + opt.multiSelectColumn, "Column is not multi-select."); + return; + } + + // Create a temporary clone of the select to use to determine the appropriate width settings. + // We'll append it to the end of the enclosing span. + var cloneId = utils.genContainerId("SPSetMultiSelectSizes", opt.multiSelectColumn, opt.listName); + var cloneObj = $("").appendTo(thisMultiSelect.container); + cloneObj.css({ + "width": "auto", // We want the clone to resize its width based on the contents + "height": 0, // Just to keep the page clean while we are using the clone + "visibility": "hidden" // And let's keep it hidden + }); + + // Add all the values to the cloned select. First the left (possible values) select... + $(thisMultiSelect.master.candidateControl).find("option").each(function () { + cloneObj.append(""); + }); + // ...then the right (selected values) select (in case some values have already been selected) + $(thisMultiSelect.master.resultControl).find("option").each(function () { + cloneObj.append(""); + }); + + // We'll add 5px for a little padding on the right. + var divWidth = cloneObj.width() + 5; + var newDivWidth = divWidth; + if (opt.minWidth > 0 || opt.maxWidth > 0) { + if (divWidth < opt.minWidth) { + divWidth = opt.minWidth; + } + if (newDivWidth < opt.minWidth) { + newDivWidth = opt.minWidth; + } + if (newDivWidth > opt.maxWidth) { + newDivWidth = opt.maxWidth; + } + } + var selectWidth = divWidth; + + // Set the new widths + $(thisMultiSelect.master.candidateControl).css("width", selectWidth + "px").parent().css("width", newDivWidth + "px"); + $(thisMultiSelect.master.resultControl).css("width", selectWidth + "px").parent().css("width", newDivWidth + "px"); + + // Remove the select's clone, since we're done with it + cloneObj.remove(); + + }; // End $.fn.SPServices.SPSetMultiSelectSizes + + return $; + +}); +/* +* spservices - Work with SharePoint's Web Services using jQuery +* Version 2.0.0-pre-alpha +* @requires jQuery v1.8 or greater - jQuery 1.10.x+ recommended +* +* Copyright (c) 2009-2016 Sympraxis Consulting LLC +* Examples and docs at: +* http://spservices.codeplex.com/ +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +*/ +/* +* @description SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. +* @type jQuery +* @name spservices +* @category Plugins/spservices +* @author Sympraxis Consulting LLC/marc.anderson@sympraxisconsulting.com +*/ +define([ + 'jquery', + '../utils/constants', + '../core/SPServices.utils', + //--------------------------- + // We don't need local variables for these dependencies + // because they are added to the jQuery namespace. + '../core/SPServices.core' +], function ( + $, + constants, + utils +) { + + "use strict"; + + // SPUpdateMultipleListItems allows you to update multiple items in a list based upon some common characteristic or metadata criteria. + $.fn.SPServices.SPUpdateMultipleListItems = function (options) { + + var opt = $.extend({}, { + webURL: "", // [Optional] URL of the target Web. If not specified, the current Web is used. + listName: "", // The list to operate on. + CAMLQuery: "", // A CAML fragment specifying which items in the list will be selected and updated + batchCmd: "Update", // The operation to perform. By default, Update. + valuepairs: [], // Valuepairs for the update in the form [[fieldname1, fieldvalue1], [fieldname2, fieldvalue2]...] + completefunc: null, // Function to call on completion of rendering the change. + debug: false // If true, show error messages;if false, run silent + }, options); + + var i; + var itemsToUpdate = []; + var documentsToUpdate = []; + + // Call GetListItems to find all of the items matching the CAMLQuery + $().SPServices({ + operation: "GetListItems", + async: false, + webURL: opt.webURL, + listName: opt.listName, + CAMLQuery: opt.CAMLQuery, + CAMLQueryOptions: "", + completefunc: function (xData) { + $(xData.responseXML).SPFilterNode("z:row").each(function () { + itemsToUpdate.push($(this).attr("ows_ID")); + var fileRef = $(this).attr("ows_FileRef"); + fileRef = "/" + fileRef.substring(fileRef.indexOf(constants.spDelim) + 2); + documentsToUpdate.push(fileRef); + }); + } + }); + + var fieldNum; + var batch = ""; + for (i = 0; i < itemsToUpdate.length; i++) { + batch += ""; + for (fieldNum = 0; fieldNum < opt.valuepairs.length; fieldNum++) { + batch += "" + utils.escapeColumnValue(opt.valuepairs[fieldNum][1]) + ""; + } + batch += "" + itemsToUpdate[i] + ""; + if (documentsToUpdate[i].length > 0) { + batch += "" + documentsToUpdate[i] + ""; + } + batch += ""; + } + batch += ""; + + // Call UpdateListItems to update all of the items matching the CAMLQuery + $().SPServices({ + operation: "UpdateListItems", + async: false, + webURL: opt.webURL, + listName: opt.listName, + updates: batch, + completefunc: function (xData) { + // If present, call completefunc when all else is done + if (opt.completefunc !== null) { + opt.completefunc(xData); + } + } + }); + + }; // End $.fn.SPServices.SPUpdateMultipleListItems + + return $; + +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNQU2VydmljZXMuY29yZS5qcyIsImNvcmUvU1BTZXJ2aWNlcy5jb3JlLmpzIiwiU1BTZXJ2aWNlcy51dGlscy5qcyIsImNvcmUvU1BTZXJ2aWNlcy51dGlscy5qcyIsIlZlcnNpb24uanMiLCJjb3JlL1ZlcnNpb24uanMiLCJjb25zdGFudHMuanMiLCJ1dGlscy9jb25zdGFudHMuanMiLCJTUENvbnZlcnREYXRlVG9JU08uanMiLCJ1dGlscy9TUENvbnZlcnREYXRlVG9JU08uanMiLCJTUERlYnVnWE1MSHR0cFJlc3VsdC5qcyIsInV0aWxzL1NQRGVidWdYTUxIdHRwUmVzdWx0LmpzIiwiU1BEcm9wZG93bkN0bC5qcyIsInV0aWxzL1NQRHJvcGRvd25DdGwuanMiLCJTUEZpbHRlck5vZGUuanMiLCJ1dGlscy9TUEZpbHRlck5vZGUuanMiLCJTUEdldEN1cnJlbnRTaXRlLmpzIiwidXRpbHMvU1BHZXRDdXJyZW50U2l0ZS5qcyIsIlNQR2V0Q3VycmVudFVzZXIuanMiLCJ1dGlscy9TUEdldEN1cnJlbnRVc2VyLmpzIiwiU1BHZXREaXNwbGF5RnJvbVN0YXRpYy5qcyIsInV0aWxzL1NQR2V0RGlzcGxheUZyb21TdGF0aWMuanMiLCJTUEdldExhc3RJdGVtSWQuanMiLCJ1dGlscy9TUEdldExhc3RJdGVtSWQuanMiLCJTUEdldExpc3RJdGVtc0pzb24uanMiLCJ1dGlscy9TUEdldExpc3RJdGVtc0pzb24uanMiLCJTUEdldFF1ZXJ5U3RyaW5nLmpzIiwidXRpbHMvU1BHZXRRdWVyeVN0cmluZy5qcyIsIlNQR2V0U3RhdGljRnJvbURpc3BsYXkuanMiLCJ1dGlscy9TUEdldFN0YXRpY0Zyb21EaXNwbGF5LmpzIiwiU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gPSB0aGlzU2l0ZSArICgodGhpc1NpdGUuY2hhckF0KHRoaXNTaXRlLmxlbmd0aCAtIDEpID09PSBjb25zdGFudHMuU0xBU0gpID8gYWpheFVSTCA6IChjb25zdGFudHMuU0xBU0ggKyBhamF4VVJMKSk7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBTT0FQRW52ZWxvcGUucGF5bG9hZCA9IFwiXCI7XHJcbiAgICAgICAgLy8gRWFjaCBvcGVyYXRpb24gcmVxdWlyZXMgYSBkaWZmZXJlbnQgc2V0IG9mIHZhbHVlcy4gIFRoaXMgc3dpdGNoIHN0YXRlbWVudCBzZXRzIHRoZW0gdXAgaW4gdGhlIFNPQVBFbnZlbG9wZS5wYXlsb2FkLlxyXG4gICAgICAgIHN3aXRjaCAob3B0Lm9wZXJhdGlvbikge1xyXG4gICAgICAgICAgICAvLyBBTEVSVCBPUEVSQVRJT05TXHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRBbGVydHNcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiRGVsZXRlQWxlcnRzXCI6XHJcbiAgICAgICAgICAgICAgICBTT0FQRW52ZWxvcGUucGF5bG9hZCArPSBcIjxJRHM+XCI7XHJcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgb3B0LklEcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgIFNPQVBFbnZlbG9wZS5wYXlsb2FkICs9IGNvbnN0YW50cy53cmFwTm9kZShcInN0cmluZ1wiLCBvcHQuSURzW2ldKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIFNPQVBFbnZlbG9wZS5wYXlsb2FkICs9IFwiPC9JRHM+XCI7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIC8vIEFVVEhFTlRJQ0FUSU9OIE9QRVJBVElPTlNcclxuICAgICAgICAgICAgY2FzZSBcIk1vZGVcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiTG9naW5cIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXNlcm5hbWVcIiwgXCJwYXNzd29yZFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIC8vIENPUFkgT1BFUkFUSU9OU1xyXG4gICAgICAgICAgICBjYXNlIFwiQ29weUludG9JdGVtc1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJTb3VyY2VVcmxcIl0pO1xyXG4gICAgICAgICAgICAgICAgU09BUEVudmVsb3BlLnBheWxvYWQgKz0gXCI8RGVzdGluYXRpb25VcmxzPlwiO1xyXG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG9wdC5EZXN0aW5hdGlvblVybHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgICAgICBTT0FQRW52ZWxvcGUucGF5bG9hZCArPSB1dGlscy53cmFwTm9kZShcInN0cmluZ1wiLCBvcHQuRGVzdGluYXRpb25VcmxzW2ldKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIFNPQVBFbnZlbG9wZS5wYXlsb2FkICs9IFwiPC9EZXN0aW5hdGlvblVybHM+XCI7XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcIkZpZWxkc1wiLCBcIlN0cmVhbVwiLCBcIlJlc3VsdHNcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJDb3B5SW50b0l0ZW1zTG9jYWxcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG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JcbiAgICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIC8vIExJU1QgT1BFUkFUSU9OU1xyXG4gICAgICAgICAgICBjYXNlIFwiQWRkQXR0YWNobWVudFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJsaXN0TmFtZVwiLCBcImxpc3RJdGVtSURcIiwgXCJmaWxlTmFtZVwiLCBcImF0dGFjaG1lbnRcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJBZGREaXNjdXNzaW9uQm9hcmRJdGVtXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImxpc3ROYW1lXCIsIFwibWVzc2FnZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkFkZExpc3RcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wibGlzdE5hbWVcIiwgXCJkZXNjcmlwdGlvblwiLCBcInRlbXBsYXRlSURcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJBZGRMaXN0RnJvbUZlYXR1cmVcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wibGlzdE5hbWVcIiwgXCJkZXNjcmlwdGlvblwiLCBcImZlYXR1cmVJRFwiLCBcInRlbXBsYXRlSURcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJBcHBseUNvbnRlbnRUeXBlVG9MaXN0XCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1Bhe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iAgICAgICAgICAgIGNhc2UgXCJEZWxldGVDb250ZW50VHlwZVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJsaXN0TmFtZVwiLCBcImNvbnRlbnRUeXBlSWRcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJEZWxldGVDb250ZW50VHlwZVhtbERvY3VtZW50XCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImxpc3ROYW1lXCIsIFwiY29udGVudFR5cGVJZFwiLCBcImRvY3VtZW50VXJpXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiRGVsZXRlTGlzdFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJsaXN0TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldEF0dGFjaG1lbnRDb2xsZWN0aW9uXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImxpc3ROYW1lXCIsIFtcImxpc3RJdGVtSURcIiwgXCJJRFwiXV0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRMaXN0XCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImxpc3ROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0TGlzdEFuZFZpZXdcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wibGlzdE5hbWVcIiwgXCJ2aWV3TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldExpc3RDb2xsZWN0aW9uXCI6XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldExpc3RDb250ZW50VHlwZVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJsaXN0TmFtZVwiLCBcImNvbnRlbnRUeXBlSWRcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRMaXN0Q29udGVudFR5cGVzXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImxpc3ROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0TGlzdEl0ZW1zXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImxpc3ROYW1lXCIsIFwidmlld05hbWVcIiwgW1wicXVlcnlcIiwgXCJDQU1MUXVlcnlcIl0sXHJcbiAgICAgICAgICAgICAgICAgICAgW1widmlld0ZpZWxkc1wiLCBcIkNBTUxWaWV3RmllbGRzXCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIFtcInJvd0xpbWl0XCIsIFwiQ0FNTFJvd0xpbWl0XCJdLFxyXG4gICAgICAgICAgICAgICAgICAgIFtcInF1ZXJ5T3B0aW9uc1wiLCBcIkNBTUxRdWVyeU9wdGlvbnNcIl1cclxuICAgICAgICAgICAgICAgIF0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRMaXN0SXRlbUNoYW5nZXNcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wibGlzdE5hbWVcIiwgXCJ2aWV3RmllbGRzXCIsIFwic2luY2VcIiwgXCJjb250YWluc1wiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldExpc3RJdGVtQ2hhbmdlc1NpbmNlVG9rZW5cIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wibGlzdE5hbWVcIiwgXCJ2aWV3TmFtZVwiLCBbXCJxdWVyeVwiLCBcIkNBTUxRdWVyeVwiXSxcclxuICAgICAgICAgICAgICAgICAgICBbXCJ2aWV3RmllbGRzXCIsIFwiQ0FNTFZpZXdGaWVsZHNcIl0sXHJcbiAgICAgICAgICAgICAgICAgICAgW1wicm93TGltaXRcIiwgXCJDQU1MUm93TGltaXRcIl0sXHJcbiAgICAgICAgICAgICAgICAgICAgW1wicXVlcnlPcHRpb25zXCIsIFwiQ0FNTFF1ZXJ5T3B0aW9uc1wiXSwge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBcImNoYW5nZVRva2VuXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbmROdWxsOiBmYWxzZVxyXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXCJjb250YWluc1wiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzZW5kTnVsbDogZmFsc2VcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VmVyc2lvbkNvbGxlY3Rpb25cIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wic3RybGlzdElEXCIsIFwic3RybGlzdEl0ZW1JRFwiLCBcInN0ckZpZWxkTmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlVuZG9DaGVja091dFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJwYWdlVXJsXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiVXBkYXRlQ29udGVudFR5cGVcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wibGlzdE5hbWVcIiwgXCJjb250ZW50VHlwZUlkXCIsIFwiY29udGVudFR5cGVQcm9wZXJ0aWVzXCIsIFwibmV3RmllbGRzXCIsIFwidXBkYXRlRmllbGRzXCIsIFwiZGVsZXRlRmllbGRzXCIsIFwiYWRkVG9WaWV3XCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiVXBkYXRlQ29udGVudFR5cGVzWG1sRG9jdW1lbnRcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wibGlzdE5hbWVcIiwgXCJuZXdEb2N1bWVudFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlVwZGF0ZUNvbnRlbnRUeXBlWG1sRG9jdW1lbnRcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wibGlzdE5hbWVcIiwgXCJjb250ZW50VHlwZUlkXCIsIFwibmV3RG9jdW1lbnRcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJVcGRhdGVMaXN0XCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImxpc3ROYW1lXCIsIFwibGlzdFByb3BlcnRpZXNcIiwgXCJuZXdGaWVsZHNcIiwgXCJ1cGRhdGVGaWVsZHNcIiwgXCJkZWxldGVGaWVsZHNcIiwgXCJsaXN0VmVyc2lvblwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlVwZGF0ZUxpc3RJdGVtc1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJsaXN0TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdC51cGRhdGVzICE9PSBcInVuZGVmaW5lZFwiICYmIG9wdC51cGRhdGVzLmxlbmd0aCA+IDApIHtcclxuICAgICAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInVwZGF0ZXNcIl0pO1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBTT0FQRW52ZWxvcGUucGF5bG9hZCArPSBcIjx1cGRhdGVzPjxCYXRjaCBPbkVycm9yPSdDb250aW51ZSc+PE1ldGhvZCBJRD0nMScgQ21kPSdcIiArIG9wdC5iYXRjaENtZCArIFwiJz5cIjtcclxuICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgb3B0LnZhbHVlcGFpcnMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgU09BUEVudmVsb3BlLnBheWxvYWQgKz0gXCI8RmllbGQgTmF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XCIsIFwidGVtcGxhdGVOYW1lXCIsIFwibGNpZFwiLCBcInRpbWVab25lSW5mb3JtYXRpb25cIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJSZW1vdmVNZWV0aW5nXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInJlY3VycmVuY2VJZFwiLCBcInVpZFwiLCBcInNlcXVlbmNlXCIsIFwidXRjRGF0ZVN0YW1wXCIsIFwiY2FuY2VsTWVldGluZ1wiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlNldFdvcmtzcGFjZVRpdGxlXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInRpdGxlXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgICAgLy8gT0ZGSUNJQUxGSUxFIE9QRVJBVElPTlNcclxuICAgICAgICAgICAgY2FzZSBcIkdldFJlY29yZFJvdXRpbmdcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wicmVjb3JkUm91dGluZ1wiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFJlY29yZFJvdXRpbmdDb2xsZWN0aW9uXCI6XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFNlcnZlckluZm9cIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiU3VibWl0RmlsZVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJmaWxlVG9TdWJtaXRcIl0sIFtcInByb3BlcnRpZXNcIl0sIFtcInJlY29yZFJvdXRpbmdcIl0sIFtcInNvdXJjZVVybFwiXSwgW1widXNlck5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcblxyXG5cclxuICAgICAgICAgICAgLy8gUEVPUExFIE9QRVJBVElPTlNcclxuICAgICAgICAgICAgY2FzZSBcIlJlc29sdmVQcmluY2lwYWxzXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInByaW5jaXBhbEtleXNcIiwgXCJwcmluY2lwYWxUeXBlXCIsIFwiYWRkVG9Vc2VySW5mb0xpc3RcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJTZWFyY2hQcmluY2lwYWxzXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInNlYXJjaFRleHRcIiwgXCJtYXhSZXN1bHRzXCIsIFwicHJpbmNpcGFsVHlwZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIC8vIFBFUk1JU1NJT04gT1BFUkFUSU9OU1xyXG4gICAgICAgICAgICBjYXNlIFwiQWRkUGVybWlzc2lvblwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJvYmplY3ROYW1lXCIsIFwib2JqZWN0VHlwZVwiLCBcInBlcm1pc3Npb25JZGVudGlmaWVyXCIsIFwicGVybWlzc2lvblR5cGVcIiwgXCJwZXJtaXNzaW9uTWFza1wiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkFkZFBlcm1pc3Npb25Db2xsZWN0aW9uXCI6XHJcbiA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l0ZVVybFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFNpdGVUZW1wbGF0ZXNcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wiTENJRFwiLCBcIlRlbXBsYXRlTGlzdFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIC8vIFNPQ0lBTERBVEFTRVJWSUNFIE9QRVJBVElPTlNcclxuICAgICAgICAgICAgY2FzZSBcIkFkZENvbW1lbnRcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXJsXCIsIFwiY29tbWVudFwiLCBcImlzSGlnaFByaW9yaXR5XCIsIFwidGl0bGVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJBZGRUYWdcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXJsXCIsIFwidGVybUlEXCIsIFwidGl0bGVcIiwgXCJpc1ByaXZhdGVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJBZGRUYWdCeUtleXdvcmRcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXJsXCIsIFwia2V5d29yZFwiLCBcInRpdGxlXCIsIFwiaXNQcml2YXRlXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiQ291bnRDb21tZW50c09mVXNlclwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJ1c2VyQWNjb3VudE5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJDb3VudENvbW1lbnRzT2ZVc2VyT25VcmxcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXNlckFjY291bnROYW1lXCIsIFwidXJsXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiQ291bnRDb21tZW50c09uVXJsXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInVybFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkNvdW50UmF0aW5nc09uVXJsXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInVybFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkNvdW50VGFnc09mVXNlclwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJ1c2VyQWNjb3VudE5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJEZWxldGVDb21tZW50XCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInVybFwiLCBcImxhc3RNb2RpZmllZFRpbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJEZWxldGVSYXRpbmdcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXJsXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiRGVsZXRlVGFnXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInVybFwiLCBcInRlcm1JRFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkRlbGV0ZVRhZ0J5S2V5d29yZFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJ1cmxcIiwgXCJrZXl3b3JkXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiRGVsZXRlVGFnc1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJ1cmxcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRBbGxUYWdUZXJtc1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJtYXhpbXVtSXRlbXNUb1JldHVyblwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldEFsbFRhZ1Rlcm1zRm9yVXJsRm9sZGVyXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInVybEZvbGRlclwiLCBcIm1heGltdW1JdGVtc1RvUmV0dXJuXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2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TtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VGFnVGVybXNPblVybFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJ1cmxcIiwgXCJtYXhpbXVtSXRlbXNUb1JldHVyblwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFRhZ1VybHNcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widGVybUlEXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VGFnVXJsc0J5S2V5d29yZFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJrZXl3b3JkXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VGFnVXJsc09mVXNlclwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJ0ZXJtSURcIiwgXCJ1c2VyQWNjb3VudE5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRUYWdVcmxzT2ZVc2VyQnlLZXl3b3JkXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImtleXdvcmRcIiwgXCJ1c2VyQWNjb3VudE5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJTZXRSYXRpbmdcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXJsXCIsIFwicmF0aW5nXCIsIFwidGl0bGVcIiwgXCJhbmFseXNpc0RhdGFFbnRyeVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlVwZGF0ZUNvbW1lbnRcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXJsXCIsIFwibGFzdE1vZGlmaWVkVGltZVwiLCBcImNvbW1lbnRcIiwgXCJpc0hpZ2hQcmlvcml0eVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIC8vIFNQRUxMQ0hFQ0sgT1BFUkFUSU9OU1xyXG4gICAgICAgICAgICBjYXNlIFwiU3BlbGxDaGVja1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJjaHVua3NUb1NwZWxsXCIsIFwiZGVjbGFyZWRMYW5ndWFnZVwiLCBcInVzZUxhZFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIC8vIFRBWE9OT01ZIE9QRVJBVElPTlNcclxuICAgICAgICAgICAgY2FzZSBcIkFkZFRlcm1zXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInNoYXJlZFNlcnZpY2VJZFwiLCBcInRlcm1TZXRJZFwiLCBcImxjaWRcIiwgXCJuZXdUZXJtc1wiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldENoaWxkVGVybXNJblRlcm1cIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFN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3B0LCBTT0FQRW52ZWxvcGUsIFtcImdyb3VwTmFtZXNYbWxcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRHcm91cENvbGxlY3Rpb25Gcm9tUm9sZVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJyb2xlTmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldEdyb3VwQ29sbGVjdGlvbkZyb21TaXRlXCI6XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldEdyb3VwQ29sbGVjdGlvbkZyb21Vc2VyXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInVzZXJMb2dpbk5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRHcm91cENvbGxlY3Rpb25Gcm9tV2ViXCI6XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldEdyb3VwSW5mb1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJncm91cE5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRSb2xlQ29sbGVjdGlvblwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJyb2xlTmFtZXNYbWxcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRSb2xlQ29sbGVjdGlvbkZyb21Hcm91cFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJncm91cE5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRSb2xlQ29sbGVjdGlvbkZyb21Vc2VyXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInVzZXJMb2dpbk5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRSb2xlQ29sbGVjdGlvbkZyb21XZWJcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0Um9sZUluZm9cIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wicm9sZU5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRSb2xlc0FuZFBlcm1pc3Npb25zRm9yQ3VycmVudFVzZXJcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0Um9sZXNBbmRQZXJtaXNzaW9uc0ZvclNpdGVcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VXNlckNvbGxlY3Rpb25cIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXNlckxvZ2luTmFtZXNYbWxcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRVc2VyQ29sbGVjdGlvbkZyb21Hcm91cFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJncm91cE5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRVc2VyQ29sbGVjdGlvbkZyb21Sb2xlXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInJvbGVOYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VXNlckNvbGxlY3Rpb25Gcm9tU2l0ZVwiOlxyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRVc2VyQ29sbGVjdGlvbkZyb21XZWJcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VXNlckluZm9cIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXNlckxvZ2luTmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFVzZXJMb2dpbkZyb21FbWFpbFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJlbWFpbFhtbFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlJlbW92ZUdyb3VwXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImdyb3VwTmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAg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ckZyb21Hcm91cFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJncm91cE5hbWVcIiwgXCJ1c2VyTG9naW5OYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiUmVtb3ZlVXNlckZyb21Sb2xlXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInJvbGVOYW1lXCIsIFwidXNlckxvZ2luTmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlJlbW92ZVVzZXJGcm9tU2l0ZVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJ1c2VyTG9naW5OYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiUmVtb3ZlVXNlckZyb21XZWJcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1widXNlckxvZ2luTmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlVwZGF0ZUdyb3VwSW5mb1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJvbGRHcm91cE5hbWVcIiwgXCJncm91cE5hbWVcIiwgXCJvd25lcklkZW50aWZpZXJcIiwgXCJvd25lclR5cGVcIiwgXCJkZXNjcmlwdGlvblwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlVwZGF0ZVJvbGVEZWZJbmZvXCI6X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ICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiLCBcIm5hbWVcIiwgXCJ1cmxcIiwgXCJncm91cFwiLCBcInByaXZhY3lcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJBZGRNZW1iZXJzaGlwXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImFjY291bnROYW1lXCIsIFwibWVtYmVyc2hpcEluZm9cIiwgXCJncm91cFwiLCBcInByaXZhY3lcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJBZGRQaW5uZWRMaW5rXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImFjY291bnROYW1lXCIsIFwibmFtZVwiLCBcInVybFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkNyZWF0ZU1lbWJlckdyb3VwXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcIm1lbWJlcnNoaXBJbmZvXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiQ3JlYXRlVXNlclByb2ZpbGVCeUFjY291bnROYW1lXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImFjY291bnROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0Q29tbW9uQ29sbGVhZ3Vlc1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldENvbW1vbk1hbmFnZXJcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wiYWNjb3VudE5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRDb21tb25NZW1iZXJzaGlwc1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldEluQ29tbW9uXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImFjY291bnROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0UHJvcGVydHlDaG9pY2VMaXN0XCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcInByb3BlcnR5TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFVzZXJDb2xsZWFndWVzXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImFjY291bnROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VXNlckxpbmtzXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImFjY291bnROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VXNlck1lbWJlcnNoaXBzXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImFjY291bnROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VXNlclBpbm5lZExpbmtzXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImFjY291bnROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VXNlclByb2ZpbGVCeUd1aWRcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wiZ3VpZFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFVzZXJQcm9maWxlQnlJbmRleFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJpbmRleFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFVzZXJQcm9maWxlQnlOYW1lXCI6XHJcbiAgICAgICAgICAgICAgICAvLyBOb3RlIHRoYXQgdGhpcyBvcGVyYXRpb24gaXMgaW5jb25zaXN0ZW50IHdpdGggdGhlIG90aGVycywgdXNpbmcgQWNjb3VudE5hbWUgcmF0aGVyIHRoYW4gYWNjb3VudE5hbWVcclxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3B0LmFjY291bnROYW1lICE9PSBcInVuZGVmaW5lZFwiICYmIG9wdC5hY2NvdW50TmFtZS5sZW5ndGggPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFtcIkFjY291bnROYW1lXCIsIFwiYWNjb3VudE5hbWVcIl1cclxuICAgICAgICAgICAgICAgICAgICBdKTtcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJBY2NvdW50TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFVzZXJQcm9maWxlQ291bnRcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VXNlclByb2ZpbGVTY2hlbWFcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0VXNlclByb3BlcnR5QnlBY2NvdW50TmFtZVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiLCBcInByb3BlcnR5TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIk1vZGlmeVVzZXJQcm9wZXJ0eUJ5QWNjb3VudE5hbWVcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wiYWNjb3VudE5hbWVcIiwgXCJuZXdEYXRhXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiUmVtb3ZlQWxsQ29sbGVhZ3Vlc1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlJlbW92ZUFsbExpbmtzXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImFjY291bnROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiUmVtb3ZlQWxsTWVtYmVyc2hpcHNcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wiYWNjb3VudE5hbWVcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJSZW1vdmVBbGxQaW5uZWRMaW5rc1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlJlbW92ZUNvbGxlYWd1ZVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiLCBcImNvbGxlYWd1ZUFjY291bnROYW1lXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiUmVtb3ZlTGlua1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiLCBcImlkXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiUmVtb3ZlTWVtYmVyc2hpcFwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiLCBcInNvdXJjZUludGVybmFsXCIsIFwic291cmNlUmVmZXJlbmNlXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiUmVtb3ZlUGlubmVkTGlua1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiLCBcImlkXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiVXBkYXRlQ29sbGVhZ3VlUHJpdmFjeVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJhY2NvdW50TmFtZVwiLCBcImNvbGxlYWd1ZUFjY291bnROYW1lXCIsIFwibmV3UHJpdmFjeVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlVwZGF0ZUxpbmtcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wiYWNjb3VudE5hbWVcIiwgXCJkYXRhXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiVXBkYXRlTWVtYmVyc2hpcFByaXZhY3lcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZ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xuICAgICAgICAgICAgY2FzZSBcIkdldENvbnRlbnRUeXBlXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcImNvbnRlbnRUeXBlSWRcIl0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRDb250ZW50VHlwZXNcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0Q3VzdG9taXplZFBhZ2VTdGF0dXNcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wiZmlsZVVybFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldExpc3RUZW1wbGF0ZXNcIjpcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0T2JqZWN0SWRGcm9tVXJsXCI6XHJcbiAgICAgICAgICAgICAgICB1dGlscy5hZGRUb1BheWxvYWQob3B0LCBTT0FQRW52ZWxvcGUsIFtcIm9iamVjdFVybFwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFdlYlwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXHJcbiAgICAgICAgICAgICAgICAgICAgW1wid2ViVXJsXCIsIFwid2ViVVJMXCJdXHJcbiAgICAgICAgICAgICAgICBdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0V2ViQ29sbGVjdGlvblwiOlxyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJHZXRBbGxTdWJXZWJDb2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ICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkNsYWltUmVsZWFzZVRhc2tcIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wiaXRlbVwiLCBcInRhc2tJZFwiLCBcImxpc3RJZFwiLCBcImZDbGFpbVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFRlbXBsYXRlc0Zvckl0ZW1cIjpcclxuICAgICAgICAgICAgICAgIHV0aWxzLmFkZFRvUGF5bG9hZChvcHQsIFNPQVBFbnZlbG9wZSwgW1wiaXRlbVwiXSk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkdldFRvRG9zRm9ySXRlbVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJpdGVtXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0V29ya2Zsb3dEYXRhRm9ySXRlbVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJpdGVtXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiR2V0V29ya2Zsb3dUYXNrRGF0YVwiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2FkKG9wdCwgU09BUEVudmVsb3BlLCBbXCJpdGVtXCIsIFwibGlzdElkXCIsIFwidGFza0lkXCJdKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiU3RhcnRXb3JrZmxvd1wiOlxyXG4gICAgICAgICAgICAgICAgdXRpbHMuYWRkVG9QYXlsb2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FRoZSByZWxhdGl2ZSBVUkwgZm9yIHRoZSBBSkFYIGNhbGxcclxuICAgICAgICAgICAgICAgIHVybDogYWpheFVSTCxcclxuICAgICAgICAgICAgICAgIC8vIEJ5IGRlZmF1bHQsIHRoZSBBSkFYIGNhbGxzIGFyZSBhc3luY2hyb25vdXMuICBZb3UgY2FuIHNwZWNpZnkgZmFsc2UgdG8gcmVxdWlyZSBhIHN5bmNocm9ub3VzIGNhbGwuXHJcbiAgICAgICAgICAgICAgICBhc3luYzogb3B0LmFzeW5jLFxyXG4gICAgICAgICAgICAgICAgLy8gT3B0aW9uYWxseSwgcGFzcyBpbiBoZWFkZXJzXHJcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxyXG4gICAgICAgICAgICAgICAgLy8gQmVmb3JlIHNlbmRpbmcgdGhlIG1zZywgbmVlZCB0byBzZW5kIHRoZSByZXF1ZXN0IGhlYWRlclxyXG4gICAgICAgICAgICAgICAgYmVmb3JlU2VuZDogZnVuY3Rpb24gKHhocikge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIElmIHdlIG5lZWQgdG8gcGFzcyB0aGUgU09BUEFjdGlvbiwgZG8gc29cclxuICAgICAgICAgICAgICAgICAgICBpZiAoV1NvcHNbb3B0Lm9wZXJhdGlvbl1bMV0pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgeGhyLnNldFJlcXVlc3RIZWFkZXIoXCJTT0FQQWN0aW9uXCIsIFNPQVBBY3Rpb24pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAvLyBBbHdheXMgYSBQT1NUXHJcbiAgICAgICAgICAgICAgICB0eXBlOiBcIlBPU1RcIixcclxuICAgICAgICAgICAgICAgIC8vIEhlcmUgaXMgdGhlIFNPQVAgcmVxdWVzdCB3ZSd2ZSBidWlsdCBhYm92ZVxyXG4gICAgICAgICAgICAgICAgZGF0YTogbXNnLFxyXG4gICAgICAgICAgICAgICAgLy8gV2UncmUgZ2V0dGluZyBYTUw7IHRlbGwgalF1ZXJ5IHNvIHRoYXQgaXQgZG9lc24ndCBuZWVkIHRvIGRvIGEgYmVzdCBndWVzc1xyXG4gICAgICAgICAgICAgICAgZGF0YVR5cGU6IFwieG1sXCIsXHJcbiAgICAgICAgICAgICAgICAvLyBhbmQgdGhpcyBpcyBpdHMgY29udGVudCB0eXBlXHJcbiAgICAgICAgICAgICAgICBjb250ZW50VHlwZTogXCJ0ZXh0L3htbDtjaGFyc2V0PSd1dGYtOCdcIixcclxuICAgICAgICAgICAgICAgIGNvbXBsZXRlOiBmdW5jdGlvbiAoeERhdGEsIFN0YXR1cykge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gdGhlIGNhbGwgaXMgY29tcGxldGUsIGNhbGwgdGhlIGNvbXBsZXRlZnVuYyBpZiB0aGVyZSBpcyBvbmVcclxuICAgICAgICAgICAgICAgICAgICBpZiAoJC5pc0Z1bmN0aW9uKG9wdC5jb21wbGV0ZWZ1bmMpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdC5jb21wbGV0ZWZ1bmMoeERhdGEsIFN0YXR1cyk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIGlmKG9wdC5jYWNoZVhNTCkge1xyXG4gICAgICAgICAgICAgICAgcHJvbWlzZXNDYWNoZVttc2ddID0gcDtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gUmV0dXJuIHRoZSBwcm9taXNlXHJcbiAgICAgICAgICAgIHJldHVybiBwO1xyXG5cclxuICAgICAgICB9IGVsc2Uge1xyXG5cclxuICAgICAgICAgICAgLy8gQ2FsbCB0aGUgY29tcGxldGVmdW5jIGlmIHRoZXJlIGlzIG9uZVxyXG4gICAgICAgICAgICBpZiAoJC5pc0Z1bmN0aW9u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yb25vdXMgY2FsbC5cclxuICAgICAgICAgICAgICAgIGFzeW5jOiBvcHQuYXN5bmMsXHJcbiAgICAgICAgICAgICAgICAvLyBCZWZvcmUgc2VuZGluZyB0aGUgbXNnLCBuZWVkIHRvIHNlbmQgdGhlIHJlcXVlc3QgaGVhZGVyXHJcbiAgICAgICAgICAgICAgICBiZWZvcmVTZW5kOiBmdW5jdGlvbiAoeGhyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UgbmVlZCB0byBwYXNzIHRoZSBTT0FQQWN0aW9uLCBkbyBzb1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChXU29wc1tvcHQub3BlcmF0aW9uXVsxXSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB4aHIuc2V0UmVxdWVzdEhlYWRlcihcIlNPQVBBY3Rpb25cIiwgU09BUEFjdGlvbik7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIC8vIEFsd2F5cyBhIFBPU1RcclxuICAgICAgICAgICAgICAgIHR5cGU6IFwiUE9TVFwiLFxyXG4gICAgICAgICAgICAgICAgLy8gSGVyZSBpcyB0aGUgU09BUCByZXF1ZXN0IHdlJ3ZlIGJ1aWx0IGFib3ZlXHJcbiAgICAgICAgICAgICAgICBkYXRhOiBtc2csXHJcbiAgICAgICAgICAgICAgICAvLyBXZSdyZSBnZXR0aW5nIFhNTDsgdGVsbCBqUXVlcnkgc28gdGhhdCBpdCBkb2Vzbid0IG5lZWQgdG8gZG8gYSBiZXN0IGd1ZXNzXHJcbiAgICAgICAgICAgICAgICBkYXRhVHlwZTogXCJ4bWxcIixcclxuICAgICAgICAgICAgICAgIC8vIGFuZCB0aGlzIGlzIGl0cyBjb250ZW50IHR5cGVcclxuICAgICAgICAgICAgICAgIGNvbnRlbnRUeXBlOiBcInRleHQveG1sO2NoYXJzZXQ9J3V0Zi04J1wiLFxyXG4gICAgICAgICAgICAgICAgY29tcGxldGU6IGZ1bmN0aW9uICh4RGF0YSwgU3RhdHVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gV2hlbiB0aGUgY2FsbCBpcyBjb21wbGV0ZSwgY2FsbCB0aGUgY29tcGxldGVmdW5jIGlmIHRoZXJlIGlzIG9uZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICgkLmlzRnVuY3Rpb24ob3B0LmNvbXBsZXRlZnVuYykpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0LmNvbXBsZXRlZnVuYyh4RGF0YSwgU3RhdHVzKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgaWYob3B0LmNhY2hlWE1MKSB7XHJcbiAgICAgICAgICAgICAgICBwcm9taXNlc0NhY2hlW21zZ10gPSBwO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBSZXR1cm4gdGhlIHByb21pc2VcclxuICAgICAgICAgICAgcmV0dXJuIHA7XHJcblxyXG4gICAgICAgIH0gZWxzZSB7XHJcblxyXG4gICAgICAgICAgICAvLyBDYWxsIHRoZSBjb21wbGV0ZWZ1bmMgaWYgdGhlcmUgaXMgb25lXHJcbiAgICAgICAgICAgIGlmICgkLmlzRnVuY3Rpb24ob3B0LmNvbXBsZXRlZnVuYykpIHtcclxuICAgICAgICAgICAgICAgIGNhY2hlZFByb21pc2UuZG9uZShmdW5jdGlvbihkYXRhLCBzdGF0dXMsIGpxWEhSKXtcclxuICAgICAgICAgICAgICAgICAgICBvcHQuY29tcGxldGVmdW5jKGpxWEhSLCBzdGF0dXMpO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIFJldHVybiB0aGUgY2FjaGVkIHByb21pc2VcclxuICAgICAgICAgICAgcmV0dXJuIGNhY2hlZFByb21pc2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gY3VycmVudCBjb250ZXh0IGFzIHdlIGZpZ3VyZSBpdCBvdXRcclxuXHJcbiAgICAgICAgLyoqXHJcbiAgICAgICAgICogV3JhcCBhbiBYTUwgbm9kZSAobikgYXJvdW5kIGEgdmFsdWUgKHYpXHJcbiAgICAgICAgICpcclxuICAgICAgICAgKi9cclxuICAgICAgICB3cmFwTm9kZTogZnVuY3Rpb24obiwgdikge1xyXG4gICAgICAgICAgICB2YXIgdGhpc1ZhbHVlID0gdHlwZW9mIHYgIT09IFwidW5kZWZpbmVkXCIgPyB2IDogXCJcIjtcclxuICAgICAgICAgICAgcmV0dXJuIFwiPFwiICsgbiArIFwiPlwiICsgdGhpc1ZhbHVlICsgXCI8L1wiICsgbiArIFwiPlwiO1xyXG4gICAgICAgIH0sXHJcblxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEdlbmVyYXRlIGEgcmFuZG9tIG51bWJlciBmb3Igc29ydGluZyBhcnJheXMgcmFuZG9tbHlcclxuICAgICAgICAgKi9cclxuICAgICAgICByYW5kT3JkOiBmdW5jdGlvbigpIHtcclxuICAgICAgICAgICAgcmV0dXJuIChNYXRoLnJvdW5kKE1hdGgucmFuZG9tKCkpIC0gMC41KTtcclxuICAgICAgICB9LFxyXG5cclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBJZiBhIHN0cmluZyBpcyBhIFVSTCwgZm9ybWF0IGl0IGFzIGEgbGluaywgZWxzZSByZXR1cm4gdGhlIHN0cmluZyBhcy1pc1xyXG4gICAgICAgICAqL1xyXG4gICAgICAgIGNoZWNrTGluazogZnVuY3Rpb24ocykge1xyXG4gICAgICAgICAgICByZXR1cm4gKChzLmluZGV4T2YoXCJodHRwXCIpID09PSAwKSB8fCAocy5pbmRleE9mKFwiL1wiKSA9PT0gMCkpID8gXCI8YSBocmVmPSdcIiArIHMgKyBcIic+XCIgKyBzICsgXCI8L2E+XCIgOiBzO1xyXG4gICAgICAgIH0sXHJcblxyXG4gICAgICAgIC8qKlxyXG4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KlxyXG4gICAgICAgICAqIEVzY2FwZSBjb2x1bW4gdmFsdWVzXHJcbiAgICAgICAgICovXHJcbiAgICAgICAgZXNjYXBlQ29sdW1uVmFsdWU6IGZ1bmN0aW9uKHMpIHtcclxuICAgICAgICAgICAgaWYgKHR5cGVvZiBzID09PSBcInN0cmluZ1wiKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcy5yZXBsYWNlKC8mKD8hW2EtekEtWl17MSw4fTspL2csIFwiJmFtcDtcIik7XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0sXHJcblxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEVzY2FwZSBVcmxcclxuICAgICAgICAgKi9cclxuICAgICAgICBlc2NhcGVVcmw6IGZ1bmN0aW9uICh1KSB7XHJcbiAgICAgICAgICAgIHJldHVybiB1LnJlcGxhY2UoLyYvZywgJyUyNicpO1xyXG4gICAgICAgIH0sXHJcblxyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIFNwbGl0IHZhbHVlcyBsaWtlIDE7I3ZhbHVlIGludG8gaWQgYW5kIHZhbHVlXHJcbiAgICAgICAgICogQHR5cGUgQ2xhc3NcclxuICAgICAgICAgKi9cclxuICAgICAgICBTcGxpdEluZGV4OiBmdW5jdGlvbihzKSB7XHJcbiAgICAgICAgICAgIHZhciBzcGwgPSBzLnNwbGl0KGNvbnN0YW50cy5zcERlbGltKTtcclxuICAgICAgICAgICAgdGhpcy5pZCA9IHNwbFswXTtcclxuICAgICAgICAgICAgdGhpcy52YWx1ZSA9IHNwbFsxXTtcclxuICAgICAgICB9LFxyXG5cclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBQYWQgc2luZ2xlIGRpZ2l0cyB3aXRoIGEgemVyb1xyXG4gICAgICAgICAqXHJcbiAgICAgICAgICogQHBhcmFtIHtOdW1iZXJ9IG5cclxuICAgICA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CAoY29sdW1uU2VsZWN0LlR5cGUpIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgY29uc3RhbnRzLmRyb3Bkb3duVHlwZS5zaW1wbGU6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hdGNoT25JZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5TZWxlY3RTZWxlY3RlZC5wdXNoKGNvbHVtblNlbGVjdC5PYmouZmluZChcIm9wdGlvbjpzZWxlY3RlZFwiKS52YWwoKSB8fCBbXSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uU2VsZWN0U2VsZWN0ZWQucHVzaChjb2x1bW5TZWxlY3QuT2JqLmZpbmQoXCJvcHRpb246c2VsZWN0ZWRcIikudGV4dCgpIHx8IFtdKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICBjYXNlIGNvbnN0YW50cy5kcm9wZG93blR5cGUuY29tcGxleDpcclxuICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2hPbklkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblNlbGVjdFNlbGVjdGVkLnB1c2goY29sdW1uU2VsZWN0Lm9wdEhpZC52YWwoKSB8fCBbXSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uU2VsZWN0U2VsZWN0ZWQucHVzaChjb2x1bW5TZWxlY3QuT2JqLnZhbCgpIHx8IFtdKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICBjYXNlIGNvbnN0YW50cy5kcm9wZG93blR5cGUubXVsdGlTZWxlY3Q6XHJcbiAgICAgICAgICAgICAgICAgICAgJChjb2x1bW5TZWxlY3QubWFzdGVyLnJlc3VsdENvbnRyb2wpLmZpbmQoXCJvcHRpb25cIikuZWFjaChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaE9uSWQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblNlbGVjdFNlbGVjdGVkLnB1c2goJCh0aGlzKS52YWwoKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5TZWxlY3RTZWxlY3RlZC5wdXNoKCQodGhpcykuaHRtbCgpKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gY29sdW1uU2VsZWN0U2VsZWN0ZWQ7XHJcblxyXG4gICAgICAgIH0sIC8vIEVuZCBvZiBmdW5jdGlvbiBnZXREcm9wZG93blNlbGVjdGVkXHJcblxyXG5cclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBHZW5lcmF0ZSBhIHVuaXF1ZSBpZCBmb3IgYSBjb250YWluaW5nIGRpdiB1c2luZyB0aGUgZnVuY3Rpb24gbmFtZSBhbmQgdGhlIGNvbHVtbiBkaXNwbGF5IG5hbWUuXHJcbiAgICAgICAgICpcclxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gZnVuY25hbWVcclxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gY29sdW1uTmFtZVxyXG4gICAgICAgICAqIEBwYXJhbSB7T2JqZWN0fSBsaXN0TmFtZVxyXG4gICAgICAgICAqL1xyXG4gICAgICAgIGdlbkNvbnRhaW5lcklkOiBmdW5jdGlv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lL21pY3Jvc29mdC5zaGFyZXBvaW50LnNwZmllbGR0eXBlKHY9b2ZmaWNlLjE1KS5hc3B4XHJcbiAgICAgICAgc3BMaXN0RmllbGRUeXBlczogW1xyXG4gICAgICAgICAgICBcIkludGVnZXJcIixcclxuICAgICAgICAgICAgXCJUZXh0XCIsXHJcbiAgICAgICAgICAgIFwiTm90ZVwiLFxyXG4gICAgICAgICAgICBcIkRhdGVUaW1lXCIsXHJcbiAgICAgICAgICAgIFwiQ291bnRlclwiLFxyXG4gICAgICAgICAgICBcIkNob2ljZVwiLFxyXG4gICAgICAgICAgICBcIkxvb2t1cFwiLFxyXG4gICAgICAgICAgICBcIkJvb2xlYW5cIixcclxuICAgICAgICAgICAgXCJOdW1iZXJcIixcclxuICAgICAgICAgICAgXCJDdXJyZW5jeVwiLFxyXG4gICAgICAgICAgICBcIlVSTFwiLFxyXG4vLyAgICAgICAgXCJDb21wdXRlZFwiLCAvLyBORVdcclxuLy8gICAgICAgIFwiVGhyZWFkaW5nXCIsIC8vIE5FV1xyXG4vLyAgICAgICAgXCJHdWlkXCIsIC8vIE5FV1xyXG4gICAgICAgICAgICBcIk11bHRpQ2hvaWNlXCIsXHJcbi8vICAgICAgICBcIkdyaWRDaG9pY2VcIiwgLy8gTkVXXHJcbiAgICAgICAgICAgIFwiQ2FsY3VsYXRlZFwiLFxyXG4gICAgICAgICAgICBcIkZpbGVcIixcclxuICAgICAgICAgICAgXCJBdHRhY2htZW50c1wiLFxyXG4gICAgICAgICAgICBcIlVzZXJcIixcclxuICAgICAgICAgICAgXCJSZWN1cnJlbmNlXCIsIC8vIFJlY3VycmluZyBldmVudCBpbmRpY2F0b3IgKGJvb2xlYW4pIFswIHwgMV1cclxuLy8gICAgICAgIFwiQ3Jvc3NQcm9qZWN0TGlua1wiLCAvLyBORVdcclxuICAgICAgICAgICAgXCJNb2RTdGF0XCIsXHJcbiAgICAgICAgICAgIFwiQ29udGVudFR5cGVJZFwiLFxyXG4vLyAgICAgICAgXCJ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iAoY29sdW1uT2JqLlR5cGUgPT09IG51bGwpIHtcclxuICAgICAgICAgICAgdmFyIGZpZWxkQ29udGFpbmVyID0gdXRpbHMuZmluZEZvcm1GaWVsZChvcHQuZGlzcGxheU5hbWUpO1xyXG4gICAgICAgICAgICBpZiAoZmllbGRDb250YWluZXIgIT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgdmFyIGZpZWxkU2VsZWN0MSA9IGZpZWxkQ29udGFpbmVyLmZpbmQoXCJzZWxlY3RbdGl0bGVePSdcIiArIG9wdC5kaXNwbGF5TmFtZSArIFwiICddW2lkJD0nX0xvb2t1cCddXCIpO1xyXG4gICAgICAgICAgICAgICAgdmFyIGZpZWxkU2VsZWN0MiA9IGZpZWxkQ29udGFpbmVyLmZpbmQoXCJzZWxlY3RbdGl0bGVePSdcIiArIG9wdC5kaXNwbGF5TmFtZSArIFwiICddW2lkJD0nTG9va3VwRmllbGQnXVwiKTtcclxuICAgICAgICAgICAgICAgIHZhciBmaWVsZFNlbGVjdCA9IGZpZWxkU2VsZWN0MS5sZW5ndGggPiAwID8gZmllbGRTZWxlY3QxIDogZmllbGRTZWxlY3QyO1xyXG5cclxuICAgICAgICAgICAgICAgIGlmIChmaWVsZFNlbGVjdCAmJiBmaWVsZFNlbGVjdC5sZW5ndGggPT09IDEpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb2x1bW5PYmouVHlwZSA9IGNvbnN0YW50cy5kcm9wZG93blR5cGUuc2ltcGxlO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbHVtbk9iai5PYmogPSBmaWVsZFNlbGVjdDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKGNvbHVtbk9iai5UeXBlID09PSBjb25zdGFudHMuZHJvcGRvd25UeXBlLmNvbXBsZXgpIHtcclxuICAgICAgICAgICAgY29sdW1uT2JqLm9wdEhpZCA9ICQoXCJpbnB1dF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GNvbXBsZXRlOiBmdW5jdGlvbiAoeERhdGEpIHtcclxuICAgICAgICAgICAgICAgIHRoaXNVc2VyRGlzcCA9IHhEYXRhO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcblxyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZmllbGRDb3VudDsgaSsrKSB7XHJcblxyXG4gICAgICAgICAgICAvLyBUaGUgY3VycmVudCB1c2VyJ3MgSUQgaXMgcmVsaWFibHkgYXZhaWxhYmxlIGluIGFuIGV4aXN0aW5nIEphdmFTY3JpcHQgdmFyaWFibGVcclxuICAgICAgICAgICAgaWYgKG9wdC5maWVsZE5hbWVzW2ldID09PSBcIklEXCIpIHtcclxuICAgICAgICAgICAgICAgIHRoaXNGaWVsZCA9IGN1cnJlbnRDb250ZXh0LnRoaXNVc2VySWQ7XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgdGhpc1RleHRWYWx1ZTtcclxuICAgICAgICAgICAgICAgIGlmIChmaWVsZENvdW50ID4gMSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXNUZXh0VmFsdWUgPSBSZWdFeHAoXCJGaWVsZEludGVybmFsTmFtZT1cXFwiXCIgKyBvcHQuZmllbGROYW1lc1tpXSArIFwiXFxcIlwiLCBcImdpXCIpO1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzVGV4dFZhbHVlID0gUmVnRXhwKFwiRmllbGRJbnRlcm5hbE5hbWU9XFxcIlwiICsgb3B0LmZpZWxkTmFtZSArIFwiXFxcIlwiLCBcImdpXCIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgJCh0aGlzVXNlckRpc3AucmVzcG9uc2VUZXh0KS5maW5kKFwidGFibGUubXMtZm9ybXRhYmxlIHRkW2lkXj0nU1BGaWVsZCddXCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzVGV4dFZhbHVlLnRlc3QoJCh0aGlzKS5odG1sKCkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEVhY2ggZmllbGR0eXBlIGNvbnRhaW5zIGEgZGlmZmVyZW50IGRhdGEgdHlwZSwgYXMgaW5kaWNhdGVkIGJ5IHRoZSBpZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCQodGhpcykuYXR0cihcImlkXCIpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiU1BGaWVsZFRleHRcIjpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzRmllbGQgPSAkKHRoaXMpLnRleHQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJTUEZpZWxkTm90ZVwiOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNGaWVsZCA9ICQodGhpcykuZmluZChcImRpdlwiKS5odG1sKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiU1BGaWVsZFVSTFwiOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNGaWVsZCA9ICQodGhpcykuZmluZChcImltZ1wiKS5hdHRyKFwic3JjXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSnVzdCBpbiBjYXNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNGaWVsZCA9ICQodGhpcykudGV4dCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0b3AgbG9va2luZzsgd2UncmUgZG9uZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKG9wdC5maWVsZE5hbWVzW2ldICE9PSBcIklEXCIpIHtcclxuICAgICAgICAgICAgICAgIHRoaXNGaWVsZCA9ICh0eXBlb2YgdGhpc0ZpZWxkICE9PSBcInVuZGVmaW5lZFwiKSA/IHRoaXNGaWVsZC5yZXBsYWNlKC8oXltcXHNcXHhBMF0rfFtcXHNcXHhBMF0rJCkvZywgJycpIDogbnVsbDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoZmllbGRDb3VudCA+IDEpIHtcclxuICAgICAgICAgICAgICAgIHRoZXNlRmllbGRzW29wdC5maWVsZE5hbWVzW2ldXSA9IHRoaXNGaWVsZDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgcmV0dXJuIChmaWVsZENvdW50ID4gMSkgPyB0aGVzZUZpZWxkcyA6IHRoaXNGaWVsZDtcclxuXHJcbiAgICB9OyAvLyBFbmQgJC5mbi5TUFNlcnZpY2VzLlNQR2V0Q3VycmVudFVzZXJcclxuXHJcbiAgICByZXR1cm4gJDtcclxuXHJcbn0pOyIsbnVsbCwiZGVmaW5lKFtcclxuICAgICdqcXVlcnknLFxyXG4gICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxyXG4gICAgLy8gV2UgZG9uJ3QgbmVlZCBsb2NhbCB2YXJpYWJsZXMgZm9yIHRoZXNlIGRlcGVuZGVuY2llc1xyXG4gICAgLy8gYmVjYXVzZSB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uZ3RoID4gMCA/IG9wdC5jb2x1bW5TdGF0aWNOYW1lcy5sZW5ndGggOiAxO1xyXG5cclxuICAgICAgICAkKCkuU1BTZXJ2aWNlcyh7XHJcbiAgICAgICAgICAgIG9wZXJhdGlvbjogXCJHZXRMaXN0XCIsXHJcbiAgICAgICAgICAgIGFzeW5jOiBmYWxzZSxcclxuICAgICAgICAgICAgY2FjaGVYTUw6IHRydWUsXHJcbiAgICAgICAgICAgIHdlYlVSTDogb3B0LndlYlVSTCxcclxuICAgICAgICAgICAgbGlzdE5hbWU6IG9wdC5saXN0TmFtZSxcclxuICAgICAgICAgICAgY29tcGxldGVmdW5jOiBmdW5jdGlvbiAoeERhdGEpIHtcclxuICAgICAgICAgICAgICAgIGlmIChuYW1lQ291bnQgPiAxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuYW1lQ291bnQ7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5TmFtZXNbb3B0LmNvbHVtblN0YXRpY05hbWVzW2ldXSA9ICQoeERhdGEucmVzcG9uc2VYTUwpLmZpbmQoXCJGaWVsZFtTdGF0aWNOYW1lPSdcIiArIG9wdC5jb2x1bW5TdGF0aWNOYW1lc1tpXSArIFwiJ11cIikuYXR0cihcIkRpc3BsYXlOYW1lXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheU5hbWUgPSAkKHhEYXRhLnJlc3BvbnNlWE1MKS5maW5kKFwiRmllbGRbU3RhdGljTmFtZT0nXCIgKyBvcHQuY29sdW1uU3RhdGljTmFtZSArIFwiJ11cIikuYXR0cihcIkRpc3BsYXlOYW1lXCIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcblxyXG4gICAgICAgIHJldHVybiAobmFtZUNv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G4gICAgICAgICAgICAgICAgZGVsZXRlZElkcy5wdXNoKCQodGhpcykudGV4dCgpKTtcclxuICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICBpZiAob3B0Lm1hcHBpbmcgPT09IG51bGwpIHtcclxuICAgICAgICAgICAgICAgIC8vIEF1dG9tYWdpY2FsbHkgY3JlYXRlIHRoZSBtYXBwaW5nXHJcbiAgICAgICAgICAgICAgICByZXNwb25zZVhtbC5maW5kKFwiTGlzdCA+IEZpZWxkcyA+IEZpZWxkXCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aGlzRmllbGQgPSAkKHRoaXMpO1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aGlzVHlwZSA9IHRoaXNGaWVsZC5hdHRyKFwiVHlwZVwiKTtcclxuICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IHdvcmsgd2l0aCBrbm93biBjb2x1bW4gdHlwZXNcclxuICAgICAgICAgICAgICAgICAgICBpZiAoJC5pbkFycmF5KHRoaXNUeXBlLCBjb25zdGFudHMuc3BMaXN0RmllbGRUeXBlcykgPj0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzTGlzdEpzb25NYXBwaW5nW1wib3dzX1wiICsgdGhpc0ZpZWxkLmF0dHIoXCJOYW1lXCIpXSA9IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcHBlZE5hbWU6IHRoaXNGaWVsZC5hdHRyKFwiTmFtZVwiKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iamVjdFR5cGU6IHRoaXNGaWVsZC5hdHRyKFwiVHlwZVwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzTGlzd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hpc0xpc3RKc29uTWFwcGluZyk7XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIHZhciBqc29uRGF0YSA9IHJlc3BvbnNlWG1sLlNQRmlsdGVyTm9kZShcIno6cm93XCIpLlNQWG1sVG9Kc29uKHtcclxuICAgICAgICAgICAgICAgIG1hcHBpbmc6IHRoaXNMaXN0SnNvbk1hcHBpbmcsXHJcbiAgICAgICAgICAgICAgICBzcGFyc2U6IHRydWVcclxuICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICB2YXIgdGhpc1Jlc3VsdCA9IHtcclxuICAgICAgICAgICAgICAgIGNoYW5nZVRva2VuOiBuZXdDaGFuZ2VUb2tlbixcclxuICAgICAgICAgICAgICAgIG1hcHBpbmc6IHRoaXNMaXN0SnNvbk1hcHBpbmcsXHJcbiAgICAgICAgICAgICAgICBkYXRhOiBqc29uRGF0YSxcclxuICAgICAgICAgICAgICAgIGRlbGV0ZWRJZHM6IGRlbGV0ZWRJZHNcclxuICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgICAgIHJlc3VsdC5yZXNvbHZlV2l0aCh0aGlzUmVzdWx0KTtcclxuXHJcbiAgICAgICAgfSxcclxuICAgICAgICBmdW5jdGlvbiAoZXJyKSB7IFxyXG4gICAgICAgICAgICByZXN1bHQucmVqZWN0V2l0aChlcnIpO1xyXG4gICAgICAgIH0pO1xyXG5cclxuICAgICAgICByZXR1cm4gcmVzdWx0LnByb21pc2UoKTtcclxuXHJcbiAgICB9OyAvLyBFbmQgJC5mbi5TUFNlcnZpY2VzLlNQR2V0TGlzdEl0ZW1zSnNvblxyXG5cclxuICAgIHJldHVybiAkO1xyXG5cclxufSk7XHJcbiIsbnVsbCwiZGVmaW5lKFtcclxuICAgICdqcXVlcnknXHJcbl0sIGZ1bmN0aW9uIChcclxuICAgICRcclxuKSB7XHJcblxyXG4gICAgXCJ1c2Ugc3RyaWN0XCI7XHJcblxyXG4gICAgLy8gR2V0IHRoZS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kZWZhdWx0Vmlld1VybC5sYXN0SW5kZXhPZihjb25zdGFudHMuU0xBU0gpICsgMSkudG9VcHBlckNhc2UoKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdFBhdGguaW5kZXhPZihsaXN0Q29sbExpc3QpID4gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50Q29udGV4dC50aGlzTGlzdCA9ICQodGhpcykuYXR0cihcIklEXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgLy8gUmV0dXJuIHRoZSBsaXN0IEdVSUQgKElEKVxyXG4gICAgICAgIHJldHVybiBjdXJyZW50Q29udGV4dC50aGlzTGlzdDtcclxuXHJcbiAgICB9OyAvLyBFbmQgJC5mbi5TUFNlcnZpY2VzLlNQTGlzdE5hbWVGcm9tVXJsXHJcblxyXG4gICAgcmV0dXJuICQ7XHJcblxyXG59KTsiLG51bGwsImRlZmluZShbXHJcbiAgICAnanF1ZXJ5JyxcclxuICAgICcuLi91dGlscy9jb25zdGFudHMnLFxyXG4gICAgJy4uL2NvcmUvU1BTZXJ2aWNlcy51dGlscydcclxuXSwgZnVuY3Rpb24gKFxyXG4gICAgJCxcclxuICAgIGNvbnN0YW50cyxcclxuICAgIHV0aWxzXHJcbikge1xyXG5cclxuICAgIFwidXNlIHN0cmljdFwiO1xyXG5cclxuICAgIC8vIFRoaXMgZnVuY3Rpb24gY29udmVydHMgYW4gWE1MIG5vZGUgc2V0IHRvIEpTT05cclxuICAgIC8vIEluaXRpYWwgaW1wbGVtZW50YXRpb24gZm9jdXNlcyBvbmx5IG9uIEdldExpc3RJdGVtc1xyXG4gICAgJC5mbi5TUFhtbFRvSnNvbiA9IGZ1bmN0aW9uIChvcHRpb25zKSB7XHJcbl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gICAgICAgICAgICAgICAgICByb3dbdGhpcy5tYXBwZWROYW1lXSA9IFwiXCI7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gUGFyc2UgdGhyb3VnaCB0aGUgZWxlbWVudCdzIGF0dHJpYnV0ZXNcclxuICAgICAgICAgICAgZm9yIChhdHRyTnVtID0gMDsgYXR0ck51bSA8IHJvd0F0dHJzLmxlbmd0aDsgYXR0ck51bSsrKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgdGhpc0F0dHJOYW1lID0gcm93QXR0cnNbYXR0ck51bV0ubmFtZTtcclxuICAgICAgICAgICAgICAgIHZhciB0aGlzTWFwcGluZyA9IG9wdC5tYXBwaW5nW3RoaXNBdHRyTmFtZV07XHJcbiAgICAgICAgICAgICAgICB2YXIgdGhpc09iamVjdE5hbWUgPSB0aGlzTWFwcGluZyAmJiB0aGlzTWFwcGluZy5tYXBwZWROYW1lID8gdGhpc01hcHBpbmcubWFwcGVkTmFtZSA6IG9wdC5yZW1vdmVPd3MgPyB0aGlzQXR0ck5hbWUuc3BsaXQoXCJvd3NfXCIpWzFdIDogdGhpc0F0dHJOYW1lO1xyXG4gICAgICAgICAgICAgICAgdmFyIHRoaXNPYmplY3RUeXBlID0gdGhpc01hcHBpbmcgIT09IHVuZGVmaW5lZCA/IHRoaXNNYXBwaW5nLm9iamVjdFR5cGUgOiB1bmRlZmluZWQ7XHJcbiAgICAgICAgICAgICAgICBpZiAob3B0LmluY2x1ZGVBbGxBdHRycyB8fCB0aGlzTWFwcGluZyAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcm93W3RoaXNPYmplY3ROYW1lXSA9IGF0dHJUb0pzb24ocm93QXR0cnNbYXR0ck51bV0udmFsdWUsIHRoaXNPYmplY3RUeXBlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBQ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AocmVzdWx0W29iamVjdFR5cGVdIHx8IGlkZW50aXR5KSh2KTtcclxuXHJcbi8qXHJcbiAgICAgICAgc3dpdGNoIChvYmplY3RUeXBlKSB7XHJcblxyXG4gICAgICAgICAgICBjYXNlIFwiVGV4dFwiOlxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSB2O1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJEYXRlVGltZVwiOlxyXG4gICAgICAgICAgICBjYXNlIFwiZGF0ZXRpbWVcIjogLy8gRm9yIGNhbGN1bGF0ZWQgY29sdW1ucywgc3RvcmVkIGFzIGRhdGV0aW1lOyN2YWx1ZVxyXG4gICAgICAgICAgICAgICAgLy8gRGF0ZXMgaGF2ZSBkYXNoZXMgaW5zdGVhZCBvZiBzbGFzaGVzOiBvd3NfQ3JlYXRlZD1cIjIwMDktMDgtMjUgMTQ6MjQ6NDhcIlxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSBkYXRlVG9Kc29uT2JqZWN0KHYpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJVc2VyXCI6XHJcbiAgICAgICAgICAgICAgICBjb2xWYWx1ZSA9IHVzZXJUb0pzb25PYmplY3Qodik7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlVzZXJNdWx0aVwiOlxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSB1c2VyTXVsdGlUb0pzb25PYmplY3Qodik7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkxvb2t1cFwiOlxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSBsb29rdXBUb0pzb25PYmplY3Qodik7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIGNhc2UgXCJMb29rdXBNdWx0aVwiOlxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSBsb29rdXBNdWx0aVRvSnNvbk9iamVjdCh2KTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiQm9vbGVhblwiOlxyXG4gICAgICAgICAgICBjYXNlIFwiQWxsRGF5RXZlbnRcIjpcclxuICAgICAgICAgICAgY2FzZSBcIlJlY3VycmVuY2VcIjpcclxuICAgICAgICAgICAgICAgIGNvbFZhbHVlID0gYm9vbGVhblRvSnNvbk9iamVjdCh2KTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgICAgY2FzZSBcIkludGVnZXJcIjpcclxuICAgICAgICAgICAgICAgIGNvbFZhbHVlID0gaW50VG9Kc29uT2JqZWN0KHYpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgICBjYXNlIFwiQ291bnRlclwiOlxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSBpbnRUb0pzb25PYmplY3Qodik7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIGNhc2UgXCJNdWx0aUNob2ljZVwiOlxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSBjaG9pY2VNdWx0aVRvSnNvbk9iamVjdCh2KTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiTnVtYmVyXCI6XHJcbiAgICAgICAgICAgIGNhc2UgXCJDdXJyZW5jeVwiOlxyXG4gICAgICAgICAgICBjYXNlIFwiZmxvYXRcIjogLy8gRm9yIGNhbGN1bGF0ZWQgY29sdW1ucywgc3RvcmVkIGFzIGZsb2F0OyN2YWx1ZVxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSBmbG9hdFRvSnNvbk9iamVjdCh2KTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiQ2FsY3VsYXRlZFwiOlxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSBjYWxjVG9Kc29uT2JqZWN0KHYpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJBdHRhY2htZW50c1wiOlxyXG4gICAgICAgICAgICAgICAgY29sVmFsdWUgPSBhdHRhY2htZW50c1RvSnNvbk9iamVjdCh2KTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiVVJMXCI6XHJcbiAgICAgICAgICAgICAgICBjb2xWYWx1ZSA9IHVybFRvSnNvbk9iamVjdCh2KTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiSlNPTlwiOlxyXG4gICAgICAgICAgICBjYXNlIFwiUmVsYXRlZEl0ZW1zXCI6XHJcbiAgICAgICAgICAgICAgICBjb2xWYWx1ZSA9IGpzb25Ub0pzb25PYmplY3Qodik7IC8vIFNwZWNpYWwgY2FzZSBmb3IgdGV4dCBKU09OIHN0b3JlZCBpbiB0ZXh0IGNvbHVtbnNcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgIC8vIEFsbCBvdGhlciBvYmplY3RUeXBlcyB3aWxsIGJlIHNpbXBsZSBzdHJpbmdzXHJcbiAgICAgICAgICAgICAgICBjb2xWYWx1ZSA9IHY7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGNvbFZhbHVlO1xyXG4gKi9cclxuICAgIH1cclxuXHJcbiAgICBmdW5jdGlvbiBpbnRUb0pzb25PYmplY3Qocykge1xyXG4gICAgICAgIHJldHVybiBwYXJzZUludChzLCAxMCk7XHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gZmxvYXRUb0pzb25PYmplY3Qocykge1xyXG4gICAgICAgIH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lOiB0aGlzVXNlci52YWx1ZVxyXG4gICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdXNlcklkOiB0aGlzVXNlci5pZCxcclxuICAgICAgICAgICAgICAgICAgICB1c2VyTmFtZTogdGhpc1VzZXJFeHBhbmRlZFswXS5yZXBsYWNlKC8oLCwpL2csIFwiLFwiKSxcclxuICAgICAgICAgICAgICAgICAgICBsb2dpbk5hbWU6IHRoaXNVc2VyRXhwYW5kZWRbMV0ucmVwbGFjZSgvKCwsKS9nLCBcIixcIiksXHJcbiAgICAgICAgICAgICAgICAgICAgZW1haWw6IHRoaXNVc2VyRXhwYW5kZWRbMl0ucmVwbGFjZSgvKCwsKS9nLCBcIixcIiksXHJcbiAgICAgICAgICAgICAgICAgICAgc2lwQWRkcmVzczogdGhpc1VzZXJFeHBhbmRlZFszXS5yZXBsYWNlKC8oLCwpL2csIFwiLFwiKSxcclxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGhpc1VzZXJFeHBhbmRlZFs0XS5yZXBsYWNlKC8oLCwpL2csIFwiLFwiKVxyXG4gICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBmdW5jdGlvbiB1c2VyTXVsdGlUb0pzb25PYmplY3Qocykge1xyXG4gICAgICAgIGlmIChzLmxlbmd0aCA9PT0gMCkge1xyXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICB2YXIgdGhpc1VzZXJNdWx0aU9iamVjdCA9IFtdO1xyXG4gICAgICAgICAgICB2YXIgdGhpc1VzZXJNdWx0aSA9IHMuc3BsaXQoY29uc3RhbnRzLnNwRGVsaW0pO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoaXNVc2VyTXVsdGkubGVuZ3RoOyBpID0gaSArIDIpIHtcclxuICAgICAgICAgICAgICAgIHZhciB0aGlzVXNlciA9IHVzZXJUb0pzb25PYmplY3QodGhpc1VzZXJNdWx0aVtpXSArIGNvbnN0YW50cy5zcERlbGltICsgdGhpc1VzZXJNdWx0aVtpICsgMV0pO1xyXG4gICAgICAgICAgICAgICAgdGhpc1VzZXJNdWx0aU9iamVjdC5wdXNoKHRoaXNVc2VyKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gdGhpc1VzZXJNdWx0aU9iamVjdDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gbG9va3VwVG9Kc29uT2JqZWN0KHMpIHtcclxuICAgICAgICBpZiAocy5sZW5ndGggPT09IDApIHtcclxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgdmFyIHRoaXNMb29rdXAgPSBzLnNwbGl0KGNvbnN0YW50cy5zcERlbGltKTtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIGxvb2t1cElkOiB0aGlzTG9va3VwWzBdLFxyXG4gICAgICAgICAgICAgICAgbG9va3VwVmFsdWU6IHRoaXNMb29rdXBbMV1cclxuICAgICAgICAgICAgfTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gbG9va3VwTXVsdGlUb0pzb25PYmplY3Qocykge1xyXG4gICAgICAgIGlmIChzLmxlbmd0aCA9PT0gMCkge1xyXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICB2YXIgdGhpc0xvb2t1cE11bHRpT2JqZWN0ID0gW107XHJcbiAgICAgICAgICAgIHZhciB0aGlzTG9va3VwTXVsdGkgPSBzLnNwbGl0KGNvbnN0YW50cy5zcERlbGltKTtcclxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzTG9va3VwTXVsdGkubGVuZ3RoOyBpID0gaSArIDIpIHtcclxuICAgICAgICAgICAgICAgIHZhciB0aGlzTG9va3VwID0gbG9va3VwVG9Kc29uT2JqZWN0KHRoaXNMb29rdXBNdWx0aVtpXSArIGNvbnN0YW50cy5zcERlbGltICsgdGhpc0xvb2t1cE11bHRpW2kgKyAxXSk7XHJcbiAgICAgICAgICAgICAgICB0aGlzTG9va3VwTXVsdGlPYmplY3QucHVzaCh0aGlzTG9va3VwKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gdGhpc0xvb2t1cE11bHRpT2JqZWN0O1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBmdW5jdGlvbiBjaG9pY2VNdWx0aVRvSnNvbk9iamVjdChzKSB7XHJcbiAgICAgICAgaWYgKHMubGVuZ3RoID09PSAwKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIHZhciB0aGlzQ2hvaWNlTXVsdGlPYmplY3QgPSBbXTtcclxuICAgICAgICAgICAgdmFyIHRoaXNDaG9pY2VNdWx0aSA9IHMuc3BsaXQoY29uc3RhbnRzLnNwRGVsaW0pO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoaXNDaG9pY2VNdWx0aS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXNDaG9pY2VNdWx0aVtpXS5sZW5ndGggIT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzQ2hvaWNlTXVsdGlPYmplY3QucHVzaCh0aGlzQ2hvaWNlTXVsdGlbaV0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiB0aGlzQ2hvaWNlTXVsdGlPYmplY3Q7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIGF0dGFjaG1lbnRzVG9Kc29uT2JqZWN0KHMpIHtcclxuICAgICAgICBpZiAocy5sZW5ndGggPT09IDApIHtcclxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICAgICAgfSBlbHNlIGlmIChzID09PSBcIjBcIiB8fCBzID09PSBcIjFcIikge1xyXG4gICAgICAgICAgICByZXR1cm4gcztcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICB2YXIgdGhpc09iamVjdCA9IFtdO1xyXG4gICAgICAgICAgICB2YXIgdGhpc1N0cmluZyA9IHMuc3BsaXQoY29uc3RhbnRzLnNwRGVsaW0pO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoaXNTdHJpbmcubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzU3RyaW5nW2ldLmxlbmd0aCAhPT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBmaWxlTmFtZSA9IHRoaXNTdHJpbmdbaV07XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXNTdHJpbmdbaV0ubGFzdEluZGV4T2YoXCIvXCIpICE9PSAtMSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9rZW5zID0gdGhpc1N0cmluZ1tpXS5zcGxpdChcIi9cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdG9rZW5zW3Rva2Vucy5sZW5ndGggLSAxXTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpc09iamVjdC5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYXR0YWNobWVudDogdGhpc1N0cmluZ1tpXSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWU6IGZpbGVOYW1lXHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIHRoaXNPYmplY3Q7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIHVybFRvSnNvbk9iamVjdChzKSB7XHJcbiAgICAgICAgaWYgKHMubGVuZ3RoID09PSAwKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIHZhciB0aGlzVXJsID0gcy5zcGxpdChcIiwgXCIpO1xyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgVXJsOiB0aGlzVXJsWzBdLFxyXG4gICAgICAgICAgICAgICAgRGVzY3JpcHRpb246IHRoaXNVcmxbMV1cclxuICAgICAgICAgICAgfTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgZnVuY3Rpb24gY2FsY1RvSnNvbk9iamVjdChzKSB7XHJcbiAgICAgICAgaWYgKHMubGVuZ3RoID09PSAwKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIHZhciB0aGlzQ2FsYyA9IHMuc3BsaXQoY29uc3RhbnRzLnNwRGVsaW0pO1xyXG4gICAgICAgICAgICAvLyBUaGUgZmlyc3QgdmFsdWUgd2lsbCBiZSB0aGUgY2FsY3VsYXRlZCBjb2x1bW4gdmFsdWUgdHlwZSwgdGhlIHNlY29uZCB3aWxsIGJlIHRoZSB2YWx1ZVxyXG4gICAgICAgICAgICByZXR1cm4gYXR0clRvSnNvbih0aGlzQ2FsY1sxXSwgdGhpc0NhbGNbMF0pO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBmdW5jdGlvbiBqc29uVG9Kc29uT2JqZWN0KHMpIHtcclxuICAgICAgICBpZiAocy5sZW5ndGggPT09IDApIH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YWluZXJJZCArIFwiJyBzdHlsZT0nd2lkdGg6XCIgKyBjb2x1bW5PYmpXaWR0aCArIFwiO2Rpc3BsYXk6bm9uZTtwYWRkaW5nOjJweDtib3JkZXI6MXB4IHNvbGlkICMyQTFGQUE7YmFja2dyb3VuZC1jb2xvcjojRkZGO3Bvc2l0aW9uOmFic29sdXRlO3otaW5kZXg6NDA7bWFyZ2luOjAnPjwvZGl2PlwiKTtcclxuXHJcbiAgICAgICAgLy8gU2V0IHRoZSB3aWR0aCB0byBtYXRjaCB0aGUgd2lkdGggb2YgdGhlIGlucHV0IGNvbnRyb2xcclxuICAgICAgICB2YXIgY29udGFpbmVyT2JqID0gJChcIiNcIiArIGNvbnRhaW5lcklkKTtcclxuICAgICAgICBjb250YWluZXJPYmouY3NzKFwid2lkdGhcIiwgY29sdW1uT2JqV2lkdGgpO1xyXG5cclxuICAgICAgICAvLyBIYW5kbGUga2V5cHJlc3Nlc1xyXG4gICAgICAgICQoY29sdW1uT2JqKS5rZXl1cChmdW5jdGlvbiAoKSB7XHJcblxyXG4gICAgICAgICAgICAvLyBHZXQgdGhlIGNvbHVtbidzIHZhbHVlXHJcbiAgICAgICAgICAgIHZhciBjb2x1bW5WYWx1ZSA9ICQodGhpcykudmFsKCk7XHJcblxyXG4gICAgICAgICAgICAvLyBIaWRlIHRoZSBjb250YWluZXIgd2hpbGUgd2UncmUgd29ya2luZyBvbiBpdFxyXG4gICAgICAgICAgICBjb250YWluZXJPYmouaGlkZSgpO1xyXG5cclxuICAgICAgICAgICAgLy8gSGF2ZSBlbm91Z2ggY2hhcmFjdGVycyBiZWVuIHR5cGVkIHlldD9cclxuICAgICAgICAgICAgaWYgKGNvbHVtblZhbHVlLmxlbmd0aCA8IG9wdC5udW1DaGFycykge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBTaG93IHRoZSB0aGUgcHJvY2Vzc2luZ0luZG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1hdGNoIGlzIG5vdCBhbHJlYWR5IGluIHRoZSBhcnJheSBpZiB3ZSB3YW50IHVuaXF1ZW5lc3NcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoIW9wdC51bmlxdWVWYWxzIHx8ICgkLmluQXJyYXkodGhpc1ZhbHVlLCBtYXRjaEFycmF5KSA9PT0gLTEpKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hdGNoQXJyYXkucHVzaCgkKHRoaXMpLmF0dHIoXCJvd3NfXCIgKyBvcHQuc291cmNlQ29sdW1uKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBIYW5kbGVzIG5vcm1hbCBjYXNlLCB3aGljaCBpcyBCZWdpbnNXaXRoIGFuZCBhbmQgb3RoZXIgdW5rbm93biB2YWx1ZXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZXN0VmFsdWUgPT09IHRoaXNWYWx1ZVRlc3Quc3Vic3RyKDAsIHRlc3RWYWx1ZS5sZW5ndGgpICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIC4uLmFuZCB0aGF0IHRoZSBtYXRjaCBpcyBub3QgYWxyZWFkeSBpbiB0aGUgYXJyYXkgaWYgd2Ugd2FudCB1bmlxdWVuZXNzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCFvcHQudW5pcXVlVmFscyB8fCAoJC5pbkFycmF5KHRoaXNWYWx1ZSwgbWF0Y2hBcnJheSkgPT09IC0xKSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXRjaEFycmF5LnB1c2goJCh0aGlzKS5hdHRyKFwib3dzX1wiICsgb3B0LnNvdXJjZUNvbHVtbikpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG5cclxuICAgICAgICAgICAgLy8gQnVpbGQgb3V0IHRoZSBzZXQgb2YgbGlzdCBlbGVtZW50cyB0byBjb250YWluIHRoZSBhdmFpbGFibGUgdmFsdWVzXHJcbiAgICAgICAgICAgIHZhciBvdXQgPSBcIlwiO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG1hdGNoQXJyYXkubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIC8vIElmIGEgaGlnaGxpZ2h0Q2xhc3MgaGFzIGJlZW4gc3VwcGxpZWQsIHdyYXAgYSBzcGFuIGFyb3VuZCBlYWNoIG1hdGNoXHJcbiAgICAgICAgICAgICAgICBpZiAob3B0LmhpZ2hsaWdodENsYXNzLmxlbmd0aCA+IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBTZXQgdXAgUmVnZXggYmFzZWQgb24gd2hldGhlciB3ZSB3YW50IHRvIGlnbm9yZSBjYXNlXHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRoaXNSZWdleCA9IG5ldyBSZWdFeHAoY29sdW1uVmFsdWUsIG9wdC5pZ25vcmVDYXNlID8gXCJnaVwiIDogXCJnXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIExvb2sgZm9yIGFsbCBvY2N1cnJlbmNlc1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBtYXRjaGVzID0gbWF0Y2hBcnJheVtpXS5tYXRjaCh0aGlzUmVnZXgpO1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBzdGFydExvYyA9IDA7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gTG9vcCBmb3IgZWFjaCBvY2N1cnJlbmNlLCB3cmFwcGluZyBlYWNoIGluIGEgc3BhbiB3aXRoIHRoZSBoaWdobGlnaHRDbGFzcyBDU1MgY2xhc3NcclxuICAgICAgICAgICAgICAgICAgICBmb3IgKG1hdGNoTnVtID0gMDsgbWF0Y2hOdW0gPCBtYXRjaGVzLmxlbmd0aDsgbWF0Y2hOdW0rKykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGhpc1BvcyA9IG1hdGNoQXJyYXlbaV0uaW5kZXhPZihtYXRjaGVzW21hdGNoTnVtXSwgc3RhcnRMb2MpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5kUG9zID0gdGhpc1BvcyArIG1hdGNoZXNbbWF0Y2hOdW1dLmxlbmd0aDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRoaXNTcGFuID0gXCI8c3BhbiBjbGFzcz0nXCIgKyBvcHQuaGlnaGxpZ2h0Q2xhc3MgKyBcIic+XCIgKyBtYXRjaGVzW21hdGNoTnVtXSArIFwiPC9zcGFuPlwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXRjaEFycmF5W2ldID0gbWF0Y2hBcnJheVtpXS5zdWJzdHIoMCwgdGhpc1BvcykgKyB0aGlzU3BhbiArIG1hdGNoQXJyYXlbaV0uc3Vic3RyKGVuZFBvcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0TG9jID0gdGhpc1BvcyArIHRoaXNTcGFuLmxlbmd0aDtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBBZGQgdGhlIHZhbHVlIHRvIHRoZSBtYXJrdXAgZm9yIHRoZSBjb250YWluZXJcclxuICAgICAgICAgICAgICAgIG91dCArPSBcIjxsaSBzdHlsZT0nZGlzcGxheTogYmxvY2s7cG9zaXRpb246IHJlbGF0aXZlO2N1cnNvcjogcG9pbnRlcjsnPlwiICsgbWF0Y2hBcnJheVtpXSArIFwiPC9saT5cIjtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gQWRkIGFsbCB0aGUgbGlzdCBlbGVtZW50cyB0byB0aGUgY29udGFpbmVySWQgY29udGFpbmVyXHJcbiAgICAgICAgICAgIGNvbnRhaW5lck9iai5odG1sKG91dCk7XHJcbiAgICAgICAgICAgIC8vIFNldCB1cCBoZWhhdmlvciBmb3IgdGhlIGF2YWlsYWJsZSB2YWx1ZXMgaW4gdGhlIGxpc3QgZWxlbWVudFxyXG4gICAgICAgICAgICAkKFwiI1wiICsgY29udGFpbmVySWQgKyBcIiBsaVwiKS5jbGljayhmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAkKFwiI1wiICsgY29udGFpbmVySWQpLmZhZGVPdXQob3B0LnNsaWRlVXBTcGVlZCk7XHJcbiAgICAgICAgICAgICAgICBjb2x1bW5PYmoudmFsKCQodGhpcykudGV4dCgpKTtcclxuICAgICAgICAgICAgfSkubW91c2VvdmVyKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIHZhciBtb3VzZW92ZXJDc3MgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgXCJjdXJzb3JcIjogXCJoYW5kXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgXCJjb2xvclwiOiBcIiNmZmZmZmZcIixcclxuICAgICAgICAgICAgICAgICAgICBcImJhY2tncm91bmRcIjogXCIjMzM5OWZmXCJcclxuICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICAkKHRoaXMpLmNzcyhtb3VzZW92ZXJDc3MpO1xyXG4gICAgICAgICAgICB9KS5tb3VzZW91dChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgbW91c2VvdXRDc3MgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgXCJjdXJzb3JcIjogXCJpbmhlcml0XCIsXHJcbiAgICAgICAgICAgICAgICAgICAgXCJjb2xvclwiOiBjb2x1bW5PYmpDb2xvcixcclxuICAgICAgICAgICAgICAgICAgICBcImJh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x1bW5TdGF0aWM7XHJcblxyXG4gICAgICAgIC8vIEdldCBpbmZvcm1hdGlvbiBhYm91dCB0aGUgY2hpbGRDb2x1bW4gZnJvbSB0aGUgY3VycmVudCBsaXN0XHJcbiAgICAgICAgJCgpLlNQU2VydmljZXMoe1xyXG4gICAgICAgICAgICBvcGVyYXRpb246IFwiR2V0TGlzdFwiLFxyXG4gICAgICAgICAgICBhc3luYzogZmFsc2UsXHJcbiAgICAgICAgICAgIGNhY2hlWE1MOiB0cnVlLFxyXG4gICAgICAgICAgICBsaXN0TmFtZTogb3B0Lmxpc3ROYW1lLFxyXG4gICAgICAgICAgICBjb21wbGV0ZWZ1bmM6IGZ1bmN0aW9uICh4RGF0YSkge1xyXG4gICAgICAgICAgICAgICAgJCh4RGF0YS5yZXNwb25zZVhNTCkuZmluZChcIkZpZWxkc1wiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAkKHRoaXMpLmZpbmQoXCJGaWVsZFtEaXNwbGF5TmFtZT0nXCIgKyBvcHQuY2hpbGRDb2x1bW4gKyBcIiddXCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBEZXRlcm1pbmUgd2hldGhlciBjaGlsZENvbHVtbiBpcyBSZXF1aXJlZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjaGlsZENvbHVtblJlcXVpcmVkID0gKCQodGhpcykuYXR0cihcIlJlcXVpcmVkXCIpID09PSBcIlRSVUVcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkQ29sdW1uU3RhdGljID0gJCh0aGlzKS5hdHRyKFwiU3RhdGljTmFtZVwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3RvcCBsb29raW5nOyB3ZSdyZSBkb25lXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAg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bGRDb2x1bW5zLnB1c2goY2hpbGRDb2x1bW4pO1xyXG4gICAgICAgICAgICBwYXJlbnRTZWxlY3QuT2JqLmRhdGEoXCJTUENhc2NhZGVEcm9wZG93bnNDaGlsZENvbHVtbnNcIiwgY2hpbGRDb2x1bW5zKTtcclxuICAgICAgICAgICAgdGhpc1BhcmVudFNldFVwID0gdHJ1ZTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIFdlIG9ubHkgbmVlZCB0byBiaW5kIHRvIHRoZSBldmVudChzKSBpZiB3ZSBoYXZlbid0IGFscmVhZHkgZG9uZSBzb1xyXG4gICAgICAgIGlmICghdGhpc1BhcmVudFNldFVwKSB7XHJcbiAgICAgICAgICAgIHN3aXRjaCAocGFyZW50U2VsZWN0LlR5cGUpIHtcclxuICAgICAgICAgICAgICAgIC8vIFBsYWluIG9sZCBzZWxlY3RcclxuICAgICAgICAgICAgICAgIGNhc2UgY29uc3RhbnRzLmRyb3Bkb3duVHlwZS5zaW1wbGU6XHJcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50U2VsZWN0Lk9iai5iaW5kKFwiY2hhbmdlXCIsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzY2FkZURyb3Bkb3duKHBhcmVudFNlbGVjdCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAvLyBJbnB1dCAvIFNlbGVjdCBoeWJyaWRcclxuICAgICAgICAgICAgICAgIGNhc2UgY29uc3RhbnRzLmRyb3Bkb3duVHlwZS5jb21wbGV4OlxyXG4gICAgICAgICAgICAgICAgICAgIC8vIEJpbmQgdG8gYW55IGNoYW5nZSBvbiB0aGUgaGlkZGVuIGlucHV0IGVsZW1lbnRcclxuICAgICAgICAgICAgICAgICAgICBwYXJlbnRTZWxlY3Qub3B0SGlkLmJpbmQoXCJwcm9wZXJ0eWNoYW5nZVwiLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2NhZGVEcm9wZG93bihwYXJlbnRTZWxlY3QpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgLy8gTXVsdGktc2VsZWN0IGh5YnJpZFxyXG4gICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLm11bHRpU2VsZWN0OlxyXG4gICAgICAgICAgICAgICAgICAgIC8vIEhhbmRsZSB0aGUgZGJsY2xpY2sgb24gdGhlIGNhbmRpZGF0ZSBzZWxlY3RcclxuICAgICAgICAgICAgICAgICAgICAkKHBhcmVudFNlbGVjdC5tYXN0ZXIuY2FuZGlkYXRlQ29udHJvbCkuYmluZChcImRibGNsaWNrXCIsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzY2FkZURyb3Bkb3duKHBhcmVudFNlbGVjdCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gSGFuZGxlIHRoZSBkYmxjbGljayBvbiB0aGUgc2VsZWN0ZWQgdmFsdWVzXHJcbiAgICAgICAgICAgICAgICAgICAgJChwYXJlbnRTZWxlY3QubWFzdGVyLnJlc3VsdENvbnRyb2wpLmJpbmQoXCJkYmxjbGlja1wiLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2NhZGVEcm9wZG93bihwYXJlbnRTZWxlY3QpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIEhhbmRsZSBidXR0b24gY2xpY2tzXHJcbiAgICAgICAgICAgICAgICAgICAgJChwYXJlbnRTZWxlY3QubWFzdGVyLmFkZENvbnRyb2wpLmJpbmQoXCJjbGlja1wiLCBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2NhZGVEcm9wZG93bihwYXJlbnRTZWxlY3QpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICQocGFyZW50U2VsZWN0Lm1hc3Rlci5yZW1vdmVDb250cm9sKS5iaW5kKFwiY2xpY2tcIiwgZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNjYWRlRHJvcGRvd24ocGFyZW50U2VsZWN0KTtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gRmlyZSB0aGUgY2hhbmdlIHRvIHNldCB0aGUgaW5pdGlhbGx5IGFsbG93YWJsZSB2YWx1ZXNcclxuICAgICAgICBjYXNjYWRlRHJvcGRvd24ocGFyZW50U2VsZWN0KTtcclxuXHJcbiAgICB9OyAvLyBFbmQgJC5mbi5TUFNlcnZpY2VzLlNQQ2FzY2FkZURyb3Bkb3duc1xyXG5cclxuICAgIGZ1bmN0aW9uIGNhc2NhZGVEcm9wZG93bihwYXJlbnRTZWxlY3QpIHtcclxuICAgICAgICB2YXIgY2hvaWNlcyA9IFwiXCI7XHJcbiAgICAgICAgdmFyIHBhcmVudFNlbGVjdFNlbGVjdGVkO1xyXG4gICAgICAgIHZhciBjaGlsZFNlbGVjdFNlbGVjdGVkID0gbnVsbDtcclxuICAgICAgICB2YXIgbmV3TXVsdGlMb29rdXBQaWNrZXJkYXRhO1xyXG4gICAgICAgIHZhciBudW1DaGlsZE9wdGlvbnM7XHJcbiAgICAgICAgdmFyIGZpcnN0Q2hpbGRPcHRpb25JZDtcclxuICAgICAgICB2YXIgZmlyc3RDaGlsZE9wdGl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uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInJlbGF0aW9uc2hpcExpc3RQYXJlbnRDb2x1bW46IFwiICsgb3B0LnJlbGF0aW9uc2hpcExpc3RQYXJlbnRDb2x1bW4gKyBcIiBvciBcIiArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJyZWxhdGlvbnNoaXBMaXN0Q2hpbGRDb2x1bW46IFwiICsgb3B0LnJlbGF0aW9uc2hpcExpc3RDaGlsZENvbHVtbixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIk5vdCBmb3VuZCBpbiByZWxhdGlvbnNoaXBMaXN0IFwiICsgb3B0LnJlbGF0aW9uc2hpcExpc3QpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5kZWJ1ZyAmJiBlcnJvclRleHQgPT09IFwiR3VpZCBzaG91bGQgY29udGFpbiAzMiBkaWdpdHMgd2l0aCA0IGRhc2hlcyAoeHh4eHh4eHgteHh4eC14eHh4LXh4eHgteHh4eHh4eHh4eHh4KS5cIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXRpbHMuZXJyQm94KHRoaXNGdW5jdGlvbixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInJlbGF0aW9uc2hpcExpc3Q6IFwiICsgb3B0LnJlbGF0aW9uc2hpcExpc3QsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJMaXN0IG5vdCBmb3VuZFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gQWRkIGFuIGV4cGxhbmF0b3J5IHByb21wdFxyXG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoY2hpbGRTZWxlY3QuVHlwZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGNvbnN0YW50cy5kcm9wZG93blR5cGUuc2ltcGxlOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIGFsbCBvZiB0aGUgZXhpc3Rpbmcgb3B0aW9uc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGRTZWxlY3QuT2JqWzBdLmlubmVySFRNTCA9IFwiXCI7XHJcbi8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoY2hpbGRTZWxlY3QuT2JqKS5maW5kKFwib3B0aW9uXCIpLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIGNvbHVtbiBpcyByZXF1aXJlZCBvciB0aGUgcHJvbXB0VGV4dCBvcHRpb24gaXMgZW1wdHksIGRvbid0IGFkZCB0aGUgcHJvbXB0IHRleHRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY2hpbGRDb2x1bW5SZXF1aXJlZCAmJiAob3B0LnByb21wdFRleHQubGVuZ3RoID4gMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZFNlbGVjdC5PYmouYXBwZW5kKFwiPG9wdGlvbiB2YWx1ZT0nMCc+XCIgKyBvcHQucHJvbXB0VGV4dC5yZXBsYWNlKC9cXHswXFx9L2csIG9wdC5jaGlsZENvbHVtbikgKyBcIjwvb3B0aW9uPlwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWNoaWxkQ29sdW1uUmVxdWlyZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZFNlbGVjdC5PYmouYXBwZW5kKFwiPG9wdGlvbiB2YWx1ZT0nMCc+XCIgKyBvcHQubm9uZVRleHQgKyBcIjwvb3B0aW9uPlwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGNvbnN0YW50cy5kcm9wZG93blR5cGUuY29tcGxleDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBjb2x1bW4gaXMgcmVxdWlyZWQsIGRvbid0IGFkZCB0aGUgXCIoTm9uZSlcIiBvcHRpb25cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob2ljZXMgPSBjaGlsZENvbHVtblJlcXVpcmVkID8gXCJcIiA6IG9wdC5ub25lVGV4dCArIFwifDBcIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkU2VsZWN0Lk9iai52YWwoXCJcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLm11bHRpU2VsZWN0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIGFsbCBvZiB0aGUgZXhpc3Rpbmcgb3B0aW9uc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJChjaGlsZFNlbGVjdC5tYXN0ZXIuY2FuZGlkYXRlQ29udHJvbCkuZmluZChcIm9wdGlvblwiKS5yZW1vdmUoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld011bHRpTG9va3VwUGlja2VyZGF0YSA9IFwiXCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAvLyBHZXQgdGhlIGNvdW50IG9mIGl0ZW1zIHJldHVybmVkIGFuZCBzYXZlIGl0IHNvIHRoYXQgd2UgY2FuIHNlbGVjdCBpZiBpdCdzIGEgc2luZ2xlIG9wdGlvbl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gICAgICAgICAgICAgICAgdGhpc09wdGlvbiA9IG5ldyB1dGlscy5TcGxpdEluZGV4KHRoaXNWYWx1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzT3B0aW9uLmlkID0gJCh0aGlzKS5hdHRyKFwib3dzX0lEXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc09wdGlvbi52YWx1ZSA9IHRoaXNWYWx1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHJlbGF0aW9uc2hpcExpc3RDaGlsZENvbHVtbiBpcyBhIGNhbGN1bGF0ZWQgY29sdW1uLCB0aGVuIHRoZSB2YWx1ZSBpc24ndCBwcmVjZWRlZCBieSB0aGUgSUQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJ1dCBieSB0aGUgZGF0YXR5cGUuICBJbiB0aGlzIGNhc2UsIHRoaXNPcHRpb24uaWQgc2hvdWxkIGJlIHRoZSBJRCBvZiB0aGUgcmVsYXRpb25zaGlwTGlzdCBpdGVtLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBlLmcuLCBmbG9hdDsjMTIzNDUuNjdcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzTmFOKHRoaXNPcHRpb24uaWQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzT3B0aW9uLmlkID0gJCh0aGlzKS5hdHRyKFwib3dzX0lEXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBTYXZlIHRoZSBpZCBhbmQgdmFsdWUgZm9yIHRoZSBmaXJzdCBjaGlsZCBvcHRpb24gaW4gY2FzZSB3ZSBuZWVkIHRvIHNlbGVjdCBpdCAoc2VsZWN0U2luZ2xlT3B0aW9uIG9wdGlvbiBpcyB0cnVlKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBmaXJzdENoaWxkT3B0aW9uSWQgPSB0aGlzT3B0aW9uLmlkO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBmaXJzdENoaWxkT3B0aW9uVmFsdWUgPSB0aGlzT3B0aW9uLnZhbHVlO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChjaGlsZFNlbGVjdC5UeXBlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGNvbnN0YW50cy5kcm9wZG93blR5cGUuc2ltcGxlOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZCA9ICgkKHRoaXMpLmF0dHIoXCJvd3NfSURcIikgPT09IGNoaWxkU2VsZWN0U2VsZWN0ZWRbMF0pID8gXCIgc2VsZWN0ZWQ9J3NlbGVjdGVkJ1wiIDogXCJcIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZFNlbGVjdC5PYmouYXBwZW5kKFwiPG9wdGlvblwiICsgc2VsZWN0ZWQgKyBcIiB2YWx1ZT0nXCIgKyB0aGlzT3B0aW9uLmlkICsgXCInPlwiICsgdGhpc09wdGlvbi52YWx1ZSArIFwiPC9vcHRpb24+XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLmNvbXBsZXg6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXNPcHRpb24uaWQgPT09IGNoaWxkU2VsZWN0U2VsZWN0ZWRbMF0pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGRTZWxlY3QuT2JqLnZhbCh0aGlzT3B0aW9uLnZhbHVlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hvaWNlcyA9IGNob2ljZXMgKyAoKGNob2ljZXMubGVuZ3RoID4gMCkgPyBcInxcIiA6IFwiXCIpICsgdGhpc09wdGlvbi52YWx1ZSArIFwifFwiICsgdGhpc09wdGlvbi5pZDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgY29uc3RhbnRzLmRyb3Bkb3duVHlwZS5tdWx0aVNlbGVjdDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKGNoaWxkU2VsZWN0Lm1hc3Rlci5jYW5kaWRhdGVDb250cm9sKS5hcHBlbmQoXCI8b3B0aW9uIHZhbHVlPSdcIiArIHRoaXNPcHRpb24uaWQgKyBcIic+XCIgKyB0aGlzT3B0aW9uLnZhbHVlICsgXCI8L29wdGlvbj5cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3TXVsdGlMb29rdXBQaWNrZXJkYXRhICs9IHRoaXNPcHRpb24uaWQgKyBcInx0XCIgKyB0aGlzT3B0aW9uLnZhbHVlICsgXCJ8dCB8dCB8dFwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGNoaWxkU2VsZWN0LlR5cGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLnNpbXBsZTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkU2VsZWN0Lk9iai50cmlnZ2VyKFwiY2hhbmdlXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlcmUgaXMgb25seSBvbmUgb3B0aW9uIGFuZCB0aGUgc2VsZWN0U2luZ2xlT3B0aW9uIG9wdGlvbiBpcyB0cnVlLCB0aGVuIHNlbGVjdCBpdFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG51bUNoaWxkT3B0aW9ucyA9PT0gMSAmJiBvcHQuc2VsZWN0U2luZ2xlT3B0aW9uID09PSB0cnVlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJChjaGlsZFNlbGVjdC5PYmopLmZpbmQoXCJvcHRpb25bdmFsdWUhPScwJ106Zmlyc3RcIikuYXR0cihcInNlbGVjdGVkXCIsIFwic2VsZWN0ZWRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLmNvbXBsZXg6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTZXQgdGhlIGFsbG93YWJsZSBjaG9pY2VzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZFNlbGVjdC5PYmouYXR0cihcImNob2ljZXNcIiwgY2hvaWNlcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGVyZSBpcyBvbmx5IG9uZSBvcHRpb24gYW5kIHRoZSBzZWxlY3RTaW5nbGVPcHRpb24gb3B0aW9uIGlzIHRydWUsIHRoZW4gc2VsZWN0IGl0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtQ2hpbGRPcHRpb25zID09PSAxICYmIG9wdC5zZWxlY3RTaW5nbGVPcHRpb24gPT09IHRydWUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTZXQgdGhlIGlucHV0IGVsZW1lbnQgdmFsdWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKGNoaWxkU2VsZWN0Lk9iaikudmFsKGZpcnN0Q2hpbGRPcHRpb25WYWx1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSB2YWx1ZSBvZiB0aGUgb3B0SGlkIGlucHV0IGVsZW1lbnRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZFNlbGVjdC5vcHRIaWQudmFsKGZpcnN0Q2hpbGRPcHRpb25JZCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGVyZSdzIG5vIHNlbGVjdGlvbiwgdGhlbiByZW1vdmUgdGhlIHZhbHVlIGluIHRoZSBhc3NvY2lhdGVkIGhpZGRlbiBpbnB1dCBlbGVtZW50IChvcHRIaWQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGRTZWxlY3QuT2JqLnZhbCgpID09PSBcIlwiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGRTZWxlY3Qub3B0SGlkLnZhbChcIlwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGNvbnN0YW50cy5kcm9wZG93blR5cGUubXVsdGlTZWxlY3Q6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDbGVhciB0aGUgbWFzdGVyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZFNlbGVjdC5tYXN0ZXIuZGF0YSA9IFwiXCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZFNlbGVjdC5NdWx0aUxvb2t1cFBpY2tlcmRhdGEudmFsKG5ld011bHRpTG9va3VwUGlja2VyZGF0YSk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ2xlYXIgYW55IHByaW9yIHNlbGVjdGlvbnMgdGhhdCBhcmUgbm8gbG9uZ2VyIHZhbGlkIG9yIGFyZW4ndCBzZWxlY3RlZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJChjaGlsZFNlbGVjdC5tYXN0ZXIucmVzdWx0Q29udHJvbCkuZmluZChcIm9wdGlvblwiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGhpc1NlbGVjdGVkID0gJCh0aGlzKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzU2VsZWN0ZWQucHJvcChcInNlbGVjdGVkXCIsIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoY2hpbGRTZWxlY3QubWFzdGVyLmNhbmRpZGF0ZUNvbnRyb2wpLmZpbmQoXCJvcHRpb25bdmFsdWU9J1wiICsgdGhpc1NlbGVjdGVkLnZhbCgpICsgXCInXVwiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1NlbGVjdGVkLnByb3AoXCJzZWxlY3RlZFwiLCBmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdpcFJlbW92ZVNlbGVjdGVkSXRlbXMoY2hpbGRTZWxlY3QubWFzdGVyKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBIaWRlIGFueSBvcHRpb25zIGluIHRoZSBjYW5kaWRhdGUgbGlzdCB3aGljaCBhcmUgYWxyZWFkeSBzZWxlY3RlZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJChjaGlsZFNlbGVjdC5tYXN0ZXIuY2FuZGlkYXRlQ29udHJvbCkuZmluZChcIm9wdGlvblwiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGhpc1NlbGVjdGVkID0gJCh0aGlzKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKGNoaWxkU2VsZWN0Lm1hc3Rlci5yZXN1bHRDb250cm9sKS5maW5kKFwib3B0aW9uW3ZhbHVlPSdcIiArIHRoaXNTZWxlY3RlZC52YWwoKSArIFwiJ11cIikuZWFjaChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNTZWxlY3RlZC5yZW1vdmUoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgR2lwQWRkU2VsZWN0ZWRJdGVtcyhjaGlsZFNlbGVjdC5tYXN0ZXIpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNldCBtYXN0ZXIuZGF0YSB0byB0aGUgbmV3bHkgYWxsb3dhYmxlIHZhbHVlc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGRTZWxlY3QubWFzdGVyLmRhdGEgPSBHaXBHZXRHcm91cERhdGEobmV3TXVsdGlMb29rdXBQaWNrZXJkYXRhKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUcmlnZ2VyIGEgZGJsY2xpY2sgc28gdGhhdCB0aGUgY2hpbGQgd2lsbCBiZSBjYXNjYWRlZCBpZiBpdCBpcyBhIG11bHRpc2VsZWN0LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJChjaGlsZFNlbGVjdC5tYXN0ZXIuY2FuZGlkYXRlQ29udHJvbCkudHJpZ2dlcihcImRibGNsaWNrXCIpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgLy8gSWYgcHJlc2VudCwgY2FsbCBjb21wbGV0ZWZ1bmMgd2hlbiBhbGwgZWxzZSBpcyBkb25lXHJcbiAgICAgICAgICAgIGlmIChvcHQuY29tcGxldGVmdW5jICE9PSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICBvcHQuY29tcGxldGVmdW5jKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTsgLy8gJChjaGlsZENvbHVtbnMpLmVhY2goZnVuY3Rpb24oKVxyXG5cclxuICAgIH0gLy8gRW5kIGNhc2NhZGVEcm9wZG93blxyXG5cclxuICAgIHJldHVybiAkO1xyXG5cclxufSk7IixudWxsLCJkZWZpbmUoW1xyXG4gICAgJ2pxdWVyeScsXHJcbiAgICBcIi4uL3V0aWxzL2NvbnN0YW50c1wiLFxyXG4gICAgJy4uL2NvcmUvU1BTZXJ2aWNlcy51dGlscycsXHJcbiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxyXG4gICAgLy8gV2UgZG9uJ3QgbmVlZCBsb2NhbCB2YXJpYWJsZXMgZm9yIHRoZXNlIGRlcGVuZGVuY2llc1xyXG4gICAgLy8gYmVjYXVzZSB0aGV5IGFyZSBhZGRlZCB0byB0aGUgalF1ZXJ5IG5hbWVzcGFjZS5cclxuICAgICcuLi9jb3JlL1NQU2VydmljZXM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2x1bW5OYW1lOiBcIiArIG9wdC5jb2x1bW5OYW1lLCBjb25zdGFudHMuVFhUQ29sdW1uTm90Rm91bmQpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICAvLyBHZXQgaW5mb3JtYXRpb24gYWJvdXQgdGhlIHJlbGF0ZWQgbGlzdCBhbmQgaXRzIGNvbHVtbnNcclxuICAgICAgICAkKCkuU1BTZXJ2aWNlcyh7XHJcbiAgICAgICAgICAgIG9wZXJhdGlvbjogXCJHZXRMaXN0XCIsXHJcbiAgICAgICAgICAgIGFzeW5jOiBmYWxzZSxcclxuICAgICAgICAgICAgY2FjaGVYTUw6IHRydWUsXHJcbiAgICAgICAgICAgIHdlYlVSTDogb3B0LnJlbGF0ZWRXZWJVUkwsXHJcbiAgICAgICAgICAgIGxpc3ROYW1lOiBvcHQucmVsYXRlZExpc3QsXHJcbiAgICAgICAgICAgIGNvbXBsZXRlZnVuYzogZnVuY3Rpb24gKHhEYXRhKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBJZiBkZWJ1ZyBpcyBvbiwgbm90aWZ5IGFib3V0IGFuIGVycm9yXHJcbiAgICAgICAgICAgICAgICAkKHhEYXRhLnJlc3BvbnNlWE1MKS5maW5kKFwiZmF1bHRjb2RlXCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHQuZGVidWcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdXRpbHMuZXJyQm94KHRoaXNGdW5jdGlvbiwgXCJyZWxhdGVkTGlzdDogXCIgKyBvcHQucmVsYXRlZExpc3QsIFwiTGlzdCBub3QgZm91bmRcIik7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgLy8gR2V0IGluZm8gYWJvdXQgdGhlIHJlbGF0ZWQgbGlzdFxyXG4gICAgICAgICAgICAgICAgc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AgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIC8vIElucHV0IC8gU2VsZWN0IGh5YnJpZFxyXG4gICAgICAgICAgICBjYXNlIGNvbnN0YW50cy5kcm9wZG93blR5cGUuY29tcGxleDpcclxuICAgICAgICAgICAgICAgIC8vIEJpbmQgdG8gYW55IGNoYW5nZSBvbiB0aGUgaGlkZGVuIGlucHV0IGVsZW1lbnRcclxuICAgICAgICAgICAgICAgIGNvbHVtblNlbGVjdC5vcHRIaWQuYmluZChcInByb3BlcnR5Y2hhbmdlXCIsIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBzaG93UmVsYXRlZChvcHQsIHJlbGF0ZWRMaXN0WE1MLCByZWxhdGVkQ29sdW1uc1hNTCk7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAvLyBNdWx0aS1zZWxlY3QgaHlicmlkXHJcbiAgICAgICAgICAgIGNhc2UgY29uc3RhbnRzLmRyb3Bkb3duVHlwZS5tdWx0aVNlbGVjdDpcclxuICAgICAgICAgICAgICAgIGlmIChvcHQuZGVidWcpIHtcclxuICAgICAgICAgICAgICAgICAgICB1dGlscy5lcnJCb3godGhpc0Z1bmN0aW9uLCBcImNvbHVtbk5hbWU6IFwiICsgb3B0LmNvbHVtbk5hbWUsIFwiTXVsdGktc2VsZWN0IGNvbHVtbnMgbm90IHN1cHBvcnRlZCBieSB0aGlzIGZ1bmN0aW9uXCIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gRmlyZSB0aGUgY2hhbmdlIHRvIHNldCB0aGUgaW5pdGlhbGx5IGFsbG93YWJsZSB2YWx1ZXNcclxu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wicmVsYXRlZExpc3RDb2x1bW46IFwiICsgb3B0LnJlbGF0ZWRMaXN0Q29sdW1uLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJDb2x1bW4gbm90IGZvdW5kIGluIHJlbGF0ZWRMaXN0IFwiICsgb3B0LnJlbGF0ZWRMaXN0KTtcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5kZWJ1ZyAmJiBlcnJvclRleHQgPT09IFwiR3VpZCBzaG91bGQgY29udGFpbiAzMiBkaWdpdHMgd2l0aCA0IGRhc2hlcyAoeHh4eHh4eHgteHh4eC14eHh4LXh4eHgteHh4eHh4eHh4eHh4KS5cIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB1dGlscy5lcnJCb3godGhpc0Z1bmN0aW9uLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJyZWxhdGVkTGlzdDogXCIgKyBvcHQucmVsYXRlZExpc3QsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIkxpc3Qgbm90IGZvdW5kXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgICAgICB2YXIgb3V0U3RyaW5nO1xyXG4gICAgICAgICAgICAgICAgLy8gT3V0cHV0IGVhY2ggcm93XHJcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKG9wdC5kaXNwbGF5Rm9ybWF0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gT25seSBpbXBsZW1lbnRpbmcgdGhlIHRhYmxlIGZvcm1hdCBpbiB0aGUgZmlyc3QgaXRlcmF0aW9uICh2MC4yLjkpXHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBcInRhYmxlXCI6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG91dFN0cmluZyA9IFwiPHRhYmxlPlwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdXRTdHJpbmcgKz0gXCI8dHI+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBvcHQucmVsYXRlZENvbHVtbnMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVsYXRlZENvbHVtbnNYTUxbb3B0LnJlbGF0ZWRDb2x1bW5zW2ldXSA9PT0gXCJ1bmRlZmluZWRcIiAmJiBvcHQuZGVidWcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1dGlscy5lcnJCb3godGhpc0Z1bmN0aW9uLCBcImNvbHVtbk5hbWU6IFwiICsgb3B0LnJlbGF0ZWRDb2x1bW5zW2ldLCBcIkNvbHVtbiBub3QgZm91bmQgaW4gcmVsYXRlZExpc3RcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0U3RyaW5nICs9IFwiPHRoIGNsYXNzPSdcIiArIG9wdC5oZWFkZXJDU1NDbGFzcyArIFwiJz5cIiArIHJlbGF0ZWRDb2x1bW5zWE1MW29wdC5yZWxhdGVkQ29sdW1uc1tpXV0uYXR0cihcIkRpc3BsYXlOYW1lXCIpICsgXCI8L3RoPlwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG91dFN0cmluZyArPSBcIjwvdHI+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFkZCBhbiBvcHRpb24gZm9yIGVhY2ggY2hpbGQgaXRlbVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAkKHhEYXRhLnJlc3BvbnNlWE1MKS5TUEZpbHRlck5vZGUoXCJ6OnJvd1wiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dFN0cmluZyArPSBcIjx0cj5cIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBvcHQucmVsYXRlZENvbHVtbnMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRTdHJpbmcgKz0gXCI8dGQgY2xhc3M9J1wiICsgb3B0LnJvd0NTU0NsYXNzICsgXCInPlwiICsgc2hvd0NvbHVtbihyZWxhdGVkTGlzdFhNTCwgcmVsYXRlZENvbHVtbnNYTUxbb3B0LnJlbGF0ZWRDb2x1bW5zW2ldXSwgJCh0aGlzKS5hdHRyKFwib3dzX1wiICsgb3B0LnJlbGF0ZWRDb2x1bW5zW2ldKSwgb3B0KSArIFwiPC90ZD5cIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dFN0cmluZyArPSBcIjwvdHI+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdXRTdHJpbmcgKz0gXCI8L3RhYmxlPlwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAvLyBsaXN0IGZvcm1hdCBpbXBsZW1lbnRlZCBpbiB2MC41LjAuIFN0aWxsIHRhYmxlLWJhc2VkLCBidXQgdmVydGljYWwgb3JpZW50YXRpb24uXHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBcImxpc3RcIjpcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3V0U3RyaW5nID0gXCI8dGFibGU+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICQoeERhdGEucmVzcG9uc2VYTUwpLlNQRmlsdGVyTm9kZShcIno6cm93XCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG9wdC5yZWxhdGVkQ29sdW1ucy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVsYXRlZENvbHVtbnNYTUxbb3B0LnJlbGF0ZWRDb2x1bW5zW2ldXSA9PT0gXCJ1bmRlZmluZWRcIiAmJiBvcHQuZGVidWcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXRpbHMuZXJyQm94KHRoaXNGdW5jdGlvbiwgXCJjb2x1bW5OYW1lOiBcIiArIG9wdC5yZWxhdGVkQ29sdW1uc1tpXSwgXCJDb2x1bW4gbm90IGZvdW5kIGluIHJlbGF0ZWRMaXN0XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dFN0cmluZyArPSBcIjx0cj5cIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRTdHJpbmcgKz0gXCI8dGggY2xhc3M9J1wiICsgb3B0LmhlYWRlckNTU0NsYXNzICsgXCInPlwiICsgcmVsYXRlZENvbHVtbnNYTUxbb3B0LnJlbGF0ZWRDb2x1bW5zW2ldXS5hdHRyKFwiRGlzcGxheU5hbWVcIikgKyBcIjwvdGg+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0U3RyaW5nICs9IFwiPHRkIGNsYXNzPSdcIiArIG9wdC5yb3dDU1NDbGFzcyArIFwiJz5cIiArIHNob3dDb2x1bW4ocmVsYXRlZExpc3RYTUwsIHJlbGF0ZWRDb2x1bW5zWE1MW29wdC5yZWxhdGVkQ29sdW1uc1tpXV0sICQodGhpcykuYXR0cihcIm93c19cIiArIG9wdC5yZWxhdGVkQ29sdW1uc1tpXSksIG9wdCkgKyBcIjwvdGQ+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0U3RyaW5nICs9IFwiPC90cj5cIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG91dFN0cmluZyArPSBcIjwvdGFibGU+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgXCJub25lXCI6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gV3JpdGUgb3V0IHRoZSByZXN1bHRzXHJcbiAgICAgICAgICAgICAgICBpZihvcHQuZGlzcGxheUZvcm1hdCAhPT0gXCJub25lXCIpIHtcclxuICAgICAgICAgICAgICAgICAgICAkKFwiI1wiICsgZGl2SWQpLmh0bWwob3V0U3RyaW5nKTtcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvLyBJZiBwcmVzZW50LCBjYWxsIGNvbXBsZXRlZnVuYyB3aGVuIGFsbCBlbHNlIGlzIGRvbmVcclxuICAgICAgICAgICAgICAgIGlmIChvcHQuY29tcGxldGVmdW5jICE9PSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgb3B0LmNvbXBsZXRlZnVuYyh4RGF0YSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9IC8vIEVuZCBzaG93UmVsYXRlZFxyXG5cclxuICAgIC8vIERpc3BsYXkgYSBjb2x1bW4gKGZpZWxkKSBmb3JtYXR0ZWQgY29ycmVjdGx5IGJhc2VkIG9uIGl0cyBkZWZpbml0a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ICAgICAgIGNhc2UgXCJUZXh0XCI6XHJcbiAgICAgICAgICAgICAgICBvdXRTdHJpbmcgPSBjb2x1bW5WYWx1ZTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiVVJMXCI6XHJcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGNvbHVtblhNTC5hdHRyKFwiRm9ybWF0XCIpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gVVJMIGFzIGh5cGVybGlua1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgXCJIeXBlcmxpbmtcIjpcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3V0U3RyaW5nID0gXCI8YSBocmVmPSdcIiArIGNvbHVtblZhbHVlLnN1YnN0cmluZygwLCBjb2x1bW5WYWx1ZS5zZWFyY2goXCIsXCIpKSArIFwiJz5cIiArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5WYWx1ZS5zdWJzdHJpbmcoY29sdW1uVmFsdWUuc2VhcmNoKFwiLFwiKSArIDEpICsgXCI8L2E+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIFVSTCBhcyBpbWFnZVxyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgXCJJbWFnZVwiOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdXRTdHJpbmcgPSBcIjxpbWcgYWx0PSdcIiArIGNvbHVtblZhbHVlLnN1YnN0cmluZyhjb2x1bW5WYWx1ZS5zZWFyY2goXCIsXCIpICsgMSkgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCInIHNyYz0nXCIgKyBjb2x1bW5WYWx1ZS5zdWJzdHJpbmcoMCwgY29sdW1uVmFsdWUuc2VhcmNoKFwiLFwiKSkgKyBcIicvPlwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAvLyBKdXN0IGluIGNhc2VcclxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdXRTdHJpbmcgPSBjb2x1bW5WYWx1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIlVzZXJcIjpcclxuICAgICAgICAgICAgY2FzZSBcIlVzZXJNdWx0aVwiOlxyXG4gICAgICAgICAgICAgICAgdmFyIHVzZXJNdWx0aVZhbHVlcyA9IGNvbHVtblZhbHVlLnNwbGl0KGNvbnN0YW50cy5zcERlbGltKTtcclxuICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB1c2VyTXVsdGlWYWx1ZXMubGVuZ3RoOyBpID0gaSArIDIpIHtcclxuICAgICAgICAgICAgICAgICAgICBvdXRBcnJheS5wdXNoKFwiPGEgaHJlZj0nL19sYXlvdXRzL3VzZXJkaXNwLmFzcHg/SUQ9XCIgKyB1c2VyTXVsdGlWYWx1ZXNbaV0gK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBcIiZTb3VyY2U9XCIgKyB1dGlscy5lc2NhcGVVcmwobG9jYXRpb24uaHJlZikgKyBcIic+XCIgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB1c2VyTXVsdGlWYWx1ZXNbaSArIDFdICsgXCI8L2E+XCIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgb3V0U3RyaW5nID0gb3V0QXJyYXkuam9pbihcIiwgXCIpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJDYWxjdWxhdGVkXCI6XHJcbiAgICAgICAgICAgICAgICB2YXIgY2FsY0NvbHVtbiA9IGNvbHVtblZhbHVlLnNwbGl0KGNvbnN0YW50cy5zcERlbGltKTtcclxuICAgICAgICAgICAgICAgIG91dFN0cmluZyA9IGNhbGNDb2x1bW5bMV07XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIk51bWJlclwiOlxyXG4gICAgICAgICAgICAgICAgbnVtRGVjaW1hbHMgPSBjb2x1bW5YTUwuYXR0cihcIkRlY2ltYWxzXCIpO1xyXG4gICAgICAgICAgICAgICAgb3V0U3RyaW5nID0gdHlwZW9mIG51bURlY2ltYWxzID09PSBcInVuZGVmaW5lZFwiID9cclxuICAgICAgICAgICAgICAgICAgICBwYXJzZUZsb2F0KGNvbHVtblZhbHVlKS50b1N0cmluZygpIDpcclxuICAgICAgICAgICAgICAgICAgICBwYXJzZUZsb2F0KGNvbHVtblZhbHVlKS50b0ZpeGVkKG51bURlY2ltYWxzKS50b1N0cmluZygpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJDdXJyZW5jeVwiOlxyXG4gICAgICAgICAgICAgICAgbnVtRGVjaW1hbHMgPSBjb2x1bW5YTUwuYXR0cihcIkRlY2ltYWxzXCIpO1xyXG4gICAgICAgICAgICAgICAgb3V0U3RyaW5nID0gdHlwZW9mIG51bURlY2ltYWxzID09PSBcInVuZGVmaW5lZFwiID9cclxuICAgICAgICAgICAgICAgICAgICBwYXJzZUZsb2F0KGNvbHVtblZhbHVlKS50b0ZpeGVkKDIpLnRvU3RyaW5nKCkgOlxyXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlRmxvYXQoY29sdW1uVmFsdWUpLnRvRml4ZWQobnVtRGVjaW1hbHMpLnRvU3RyaW5nKCk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkxvb2t1cFwiOlxyXG4gICAgICAgICAgICAgICAgc3dpdGNoIChjb2x1bW5YTUwuYXR0cihcIk5hbWVcIikpIHtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIFwiRmlsZVJlZlwiOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBHZXQgdGhlIGRpc3BsYXkgZm9ybSBVUkwgZm9yIHRoZSBsb29rdXAgc291cmNlIGxpc3RcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGlzcFVybCA9IGxpc3RYTUwuYXR0cihcIkJhc2VUeXBlXCIpID09PSBcIjFcIiA/IGxpc3RYTUwuYXR0cihcIlJvb3RGb2xkZXJcIikgKyBjb25zdGFudHMuU0xBU0ggKyBcIkZvcm1zL0Rpc3BGb3JtLmFzcHhcIiA6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RYTUwuYXR0cihcIlJvb3RGb2xkZXJcIikgKyBjb25zdGFudHMuU0xBU0ggKyBcIkRpc3BGb3JtLmFzcHhcIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3V0U3RyaW5nID0gXCI8YSBocmVmPSdcIiArIGRpc3BVcmwgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCI/SUQ9XCIgKyBjb2x1bW5WYWx1ZS5zdWJzdHJpbmcoMCwgY29sdW1uVmFsdWUuc2VhcmNoKGNvbnN0YW50cy5zcERlbGltKSkgKyBcIiZSb290Rm9sZGVyPSomU291cmNlPVwiICsgdXRpbHMuZXNjYXBlVXJsKGxvY2F0aW9uLmhyZWYpICsgXCInPlwiICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblZhbHVlLnN1YnN0cmluZyhjb2x1bW5WYWx1ZS5zZWFyY2goY29uc3RhbnRzLnNwRGVsaW0pICsgMikgKyBcIjwvYT5cIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBcIkZpbGVEaXJSZWZcIjpcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gR2V0IHRoZSBkaXNwbGF5IGZvcm0gVVJMIGZvciB0aGUgbG9va3VwIHNvdXJjZSBsaXN0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BVcmwgPSBjb25zdGFudHMuU0xBU0ggKyBjb2x1bW5WYWx1ZS5zdWJzdHJpbmcoY29sdW1uVmFsdWUuc2VhcmNoKGNvbnN0YW50cy5zcERlbGltKSArIDIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdXRTdHJpbmcgPSBcIjxhIGhyZWY9J1wiICsgZGlzcFVybCArIFwiJz5cIiArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5WYWx1ZS5zdWJzdHJpbmcoY29sdW1uVmFsdWUuc2VhcmNoKGNvbnN0YW50cy5zcERlbGltKSArIDIpICsgXCI8L2E+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIEFueSBvdGhlciBsb29rdXAgY29sdW1uXHJcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gR2V0IHRoZSBkaXNwbGF5IGZvcm0gVVJMIGZvciB0aGUgbG9va3VwIHNvdXJjZSBsaXN0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BVcmwgPSB1dGlscy5nZXRMaXN0Rm9ybVVybChjb2x1bW5YTUwuYXR0cihcIkxpc3RcIiksIFwiRGlzcGxheUZvcm1cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG91dFN0cmluZyA9IFwiPGEgaHJlZj0nXCIgKyBvcHQucmVsYXRlZFdlYlVSTCArIGNvbnN0YW50cy5TTEFTSCArIGRpc3BVcmwgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCI/SUQ9XCIgKyBjb2x1bW5WYWx1ZS5zdWJzdHJpbmcoMCwgY29sdW1uVmFsdWUuc2VhcmNoKGNvbnN0YW50cy5zcERlbGltKSkgKyBcIiZSb290Rm9sZGVyPSomU291cmNlPVwiICsgdXRpbHMuZXNjYXBlVXJsKGxvY2F0aW9uLmhyZWYpICsgXCInPlwiICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblZhbHVlLnN1YnN0cmluZyhjb2x1bW5WYWx1ZS5zZWFyY2goY29uc3RhbnRzLnNwRGVsaW0pICsgMikgKyBcIjwvYT5cIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkxvb2t1cE11bHRpXCI6XHJcbiAgICAgICAgICAgICAgICAvLyBHZXQgdGhlIGRpc3BsYXkgZm9ybSBVUkwgZm9yIHRoZSBsb29rdXAgc291cmNlIGxpc3RcclxuICAgICAgICAgICAgICAgIGRpc3BVcmwgPSB1dGlscy5nZXRMaXN0Rm9ybVVybChjb2x1bW5YTUwuYXR0cihcIkxpc3RcIiksIFwiRGlzcGxheUZvcm1cIik7XHJcbiAgICAgICAgICAgICAgICAvLyBTaG93IGFsbCB0aGUgdmFsdWVzIGFzIGxpbmtzIHRvIHRoZSBpdGVtcywgc2VwYXJhdGVkIGJ5IGNvbW1hc1xyXG4gICAgICAgICAgICAgICAgb3V0U3RyaW5nID0gXCJcIjtcclxuICAgICAgICAgICAgICAgIGlmIChjb2x1bW5WYWx1ZS5sZW5ndGggPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxvb2t1cE11bHRpVmFsdWVzID0gY29sdW1uVmFsdWUuc3BsaXQoY29uc3RhbnRzLnNwRGVsaW0pO1xyXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsb29rdXBNdWx0aVZhbHVlcy5sZW5ndGggLyAyOyBpKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3V0QXJyYXkucHVzaChcIjxhIGhyZWY9J1wiICsgd2ViVXJsICsgY29uc3RhbnRzLlNMQVNIICsgZGlzcFVybCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIj9JRD1cIiArIGxvb2t1cE11bHRpVmFsdWVzW2kgKiAyXSArIFwiJlJvb3RGb2xkZXI9KiZTb3VyY2U9XCIgKyB1dGlscy5lc2NhcGVVcmwobG9jYXRpb24uaHJlZikgKyBcIic+XCIgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9va3VwTXVsdGlWYWx1ZXNbKGkgKiAyKSArIDFdICsgXCI8L2E+XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIG91dFN0cmluZyA9IG91dEFycmF5LmpvaW4oXCIsIFwiKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiRmlsZVwiOlxyXG4gICAgICAgICAgICAgICAgZmlsZU5hbWUgPSBjb2x1bW5WYWx1ZS5zdWJzdHJpbmcoY29sdW1uVmFsdWUuc2VhcmNoKGNvbnN0YW50cy5zcERlbGltKSArIDIpO1xyXG4gICAgICAgICAgICAgICAgb3V0U3RyaW5nID0gXCI8YSBocmVmPSdcIiArIGxpc3RYTUwuYXR0cihcIlJvb3RGb2xkZXJcIikgKyBjb25zdGFudHMuU0xBU0ggKyBmaWxlTmFtZSArIFwiJz5cIiArIGZpbGVOYW1lICsgXCI8L2E+XCI7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBcIkNvdW50ZXJcIjpcclxuICAgICAgICAgICAgICAgIG91dFN0cmluZyA9IGNvbHVtblZhbHVlO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgXCJEYXRlVGltZVwiOlxyXG4gICAgICAgICAgICAgICAgb3V0U3RyaW5nID0gY29sdW1uVmFsdWU7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgIG91dFN0cmluZyA9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clxuICAgICAgICAgICAgY29tcGxldGVmdW5jOiBmdW5jdGlvbiAoeERhdGEpIHtcclxuICAgICAgICAgICAgICAgICQoeERhdGEucmVzcG9uc2VYTUwpLmZpbmQoXCJGaWVsZHNcIikuZWFjaChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgJCh0aGlzKS5maW5kKFwiRmllbGRbRGlzcGxheU5hbWU9J1wiICsgb3B0LmNvbHVtbk5hbWUgKyBcIiddXCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBEZXRlcm1pbmUgd2hldGhlciBjb2x1bW5OYW1lIGlzIFJlcXVpcmVkXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbkNvbHVtblJlcXVpcmVkID0gKCQodGhpcykuYXR0cihcIlJlcXVpcmVkXCIpID09PSBcIlRSVUVcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0b3AgbG9va2luZzsgd2UncmUgZG9uZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG5cclxuICAgICAgICAkKCkuU1BTZXJ2aWNlcyh7XHJcbiAgICAgICAgICAgIG9wZXJhdGlvbjogXCJHZXRMaXN0SXRlbXNcIixcclxuICAgICAgICAgICAgLy8gRm9yY2Ugc3luYyBzbyB0aGF0IHdlIGhhdmUgdGhlIHJpZ2h0IHZhbHVlcyBmb3IgdGhlIGNvbHVtbiBvbmNoYW5nZSB0cmlnZ2VyXHJcbiAgICAgICAgICAgIGFzeW5jOiBmYWxzZSxcclxuICAgICAgICAgICAgd2ViVVJMOiBvcHQucmVsYXRpb25zaGlwV2ViVVJMLFxyXG4gICAgICAgICAgICBsaXN0TmFtZTogb3B0LnJlbGF0aW9uc2hp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HZhciBlcnJvclRleHQgPSAkKHRoaXMpLnRleHQoKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAob3B0LmRlYnVnICYmIGVycm9yVGV4dCA9PT0gXCJPbmUgb3IgbW9yZSBmaWVsZCB0eXBlcyBhcmUgbm90IGluc3RhbGxlZCBwcm9wZXJseS4gR28gdG8gdGhlIGxpc3Qgc2V0dGluZ3MgcGFnZSB0byBkZWxldGUgdGhlc2UgZmllbGRzLlwiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHV0aWxzLmVyckJveCh0aGlzRnVuY3Rpb24sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInJlbGF0aW9uc2hpcExpc3RDb2x1bW46IFwiICsgb3B0LnJlbGF0aW9uc2hpcExpc3RDb2x1bW4sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIk5vdCBmb3VuZCBpbiByZWxhdGlvbnNoaXBMaXN0IFwiICsgb3B0LnJlbGF0aW9uc2hpcExpc3QpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0LmRlYnVnICYmIGVycm9yVGV4dCA9PT0gXCJHdWlkIHNob3VsZCBjb250YWluIDMyIGRpZ2l0cyB3aXRoIDQgZGFzaGVzICh4eHh4eHh4eC14eHh4LXh4eHgteHh4eC14eHh4eHh4eHh4eHgpLlwiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHV0aWxzLmVyckJveCh0aGlzRnVuY3Rpb24sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInJlbGF0aW9uc2hpcExpc3Q6IFwiICsgb3B0LnJlbGF0aW9uc2hpcExpc3QsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIkxpc3Qgbm90IGZvdW5kXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBBZGQgYW4gZXhwbGFuYXRvcnkgcHJvbXB0XHJcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGNvbHVtblNlbGVjdC5UeXBlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLnNpbXBsZTpcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIGFsbCBvZiB0aGUgZXhpc3Rpbmcgb3B0aW9uc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAkKGNvbHVtblNlbGVjdC5PYmopLmZpbmQoXCJvcHRpb25cIikucmVtb3ZlKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBjb2x1bW4gaXMgcmVxdWlyZWQgb3IgdGhlIHByb21wdFRleHQgb3B0aW9uIGlzIGVtcHR5LCBkb24ndCBhZGQgdGhlIHByb21wdCB0ZXh0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29sdW1uQ29sdW1uUmVxdWlyZWQgJiYgKG9wdC5wcm9tcHRUZXh0Lmxlbmd0aCA+IDApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5TZWxlY3QuT2JqLmFwcGVuZChcIjxvcHRpb24gdmFsdWU9JzAnPlwiICsgb3B0LnByb21wdFRleHQucmVwbGFjZSgvXFx7MFxcfS9nLCBvcHQuY29sdW1uTmFtZSkgKyBcIjwvb3B0aW9uPlwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghY29sdW1uQ29sdW1uUmVxdWlyZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblNlbGVjdC5PYmouYXBwZW5kKFwiPG9wdGlvbiB2YWx1ZT0nMCc+XCIgKyBvcHQubm9uZVRleHQgKyBcIjwvb3B0aW9uPlwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIGNvbnN0YW50cy5kcm9wZG93blR5cGUuY29tcGxleDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIGNvbHVtbiBpcyByZXF1aXJlZCwgZG9uJ3QgYWRkIHRoZSBcIihOb25lKVwiIG9wdGlvblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjaG9pY2VzID0gY29sdW1uQ29sdW1uUmVxdWlyZWQgPyBcIlwiIDogb3B0Lm5vbmVUZXh0ICsgXCJ8MFwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5TZWxlY3QuT2JqLnZhbChcIlwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLm11bHRpU2VsZWN0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBSZW1vdmUgYWxsIG9mIHRoZSBleGlzdGluZyBvcHRpb25zXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICQoY29sdW1uU2VsZWN0Lm1hc3Rlci5jYW5kaWRhdGVDb250cm9sKS5maW5kKFwib3B0aW9uXCIpLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdNdWx0aUxvb2t1cFBpY2tlcmRhdGEgPSBcIlwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvLyBBZGQgYW4gb3B0aW9uIGZvciBlYWNoIGl0ZW1cclxuICAgICAgICAgICAgICAgICQoeERhdGEucmVzcG9uc2VYTUwpLlNQRmlsdGVyTm9kZShcIno6cm93XCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG5cclxuICAgICAgICAgIC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hdHlwZS4gIEluIHRoaXMgY2FzZSwgdGhpc09wdGlvbi5pZCBzaG91bGQgYmUgdGhlIElEIG9mIHRoZSByZWxhdGlvbnNoaXBMaXN0IGl0ZW0uXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gZS5nLiwgZmxvYXQ7IzEyMzQ1LjY3XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzTmFOKHRoaXNPcHRpb24uaWQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNPcHRpb24uaWQgPSAkKHRoaXMpLmF0dHIoXCJvd3NfSURcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGNvbHVtblNlbGVjdC5UeXBlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgY29uc3RhbnRzLmRyb3Bkb3duVHlwZS5zaW1wbGU6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWQgPSAoJCh0aGlzKS5hdHRyKFwib3dzX0lEXCIpID09PSBjb2x1bW5TZWxlY3RTZWxlY3RlZFswXSkgPyBcIiBzZWxlY3RlZD0nc2VsZWN0ZWQnXCIgOiBcIlwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uU2VsZWN0Lk9iai5hcHBlbmQoXCI8b3B0aW9uXCIgKyBzZWxlY3RlZCArIFwiIHZhbHVlPSdcIiArIHRoaXNPcHRpb24uaWQgKyBcIic+XCIgKyB0aGlzT3B0aW9uLnZhbHVlICsgXCI8L29wdGlvbj5cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLmNvbXBsZXg6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpc09wdGlvbi5pZCA9PT0gY29sdW1uU2VsZWN0U2VsZWN0ZWRbMF0pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW5TZWxlY3QuT2JqLnZhbCh0aGlzT3B0aW9uLnZhbHVlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob2ljZXMgPSBjaG9pY2VzICsgKChjaG9pY2VzLmxlbmd0aCA+IDApID8gXCJ8XCIgOiBcIlwiKSArIHRoaXNPcHRpb24udmFsdWUgKyBcInxcIiArIHRoaXNPcHRpb24uaWQ7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLm11bHRpU2VsZWN0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJChjb2x1bW5TZWxlY3QubWFzdGVyLmNhbmRpZGF0ZUNvbnRyb2wpLmFwcGVuZChcIjxvcHRpb24gdmFsdWU9J1wiICsgdGhpc09wdGlvbi5pZCArIFwiJz5cIiArIHRoaXNPcHRpb24udmFsdWUgKyBcIjwvb3B0aW9uPlwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld011bHRpTG9va3VwUGlja2VyZGF0YSArPSB0aGlzT3B0aW9uLmlkICsgXCJ8dFwiICsgdGhpc09wdGlvbi52YWx1ZSArIFwifHQgfHQgfHRcIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICAgICAgc3dpdGNoIChjb2x1bW5TZWxlY3QuVHlwZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgY29uc3RhbnRzLmRyb3Bkb3duVHlwZS5zaW1wbGU6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblNlbGVjdC5PYmoudHJpZ2dlcihcImNoYW5nZVwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBjb25zdGFudHMuZHJvcGRvd25UeXBlLmNvbXBsZXg6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblNlbGVjdC5PYmouYXR0cihcImNob2ljZXNcIiwgY2hvaWNlcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblNlbGVjdC5PYmoudHJpZ2dlcihcInByb3BlcnR5Y2hhbmdlXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIGNvbnN0YW50cy5kcm9wZG93blR5cGUubXVsdGlTZWxlY3Q6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIENsZWFyIHRoZSBtYXN0ZXJcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uU2VsZWN0Lm1hc3Rlci5kYXRhID0gXCJcIjtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblNlbGVjdC5NdWx0aUxvb2t1cFBpY2tlcmRhdGEudmFsKG5ld011bHRpTG9va3VwUGlja2VyZGF0YSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIENsZWFyIGFueSBwcmlvciBzZWxlY3Rpb25zIHRoYXQgYXJlIG5vIGxvbmdlciB2YWxpZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAkKGNvbHVtblNlbGVjdC5tYXN0ZXIucmVzdWx0Q29udHJvbCkuZmluZChcIm9wdGlvblwiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aGlzU2VsZWN0ZWQgPSAkKHRoaXMpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCh0aGlzKS5hdHRyKFwic2VsZWN0ZWRcIiwgXCJzZWxlY3RlZFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoY29sdW1uU2VsZWN0Lm1hc3Rlci5jYW5kaWRhdGVDb250cm9sKS5maW5kKFwib3B0aW9uXCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkKHRoaXMpLmh0bWwoKSA9PT0gdGhpc1NlbGVjdGVkLmh0bWwoKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzU2VsZWN0ZWQucmVtb3ZlQXR0cihcInNlbGVjdGVkXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgR2lwUmVtb3ZlU2VsZWN0ZWRJdGVtcyhjb2x1bW5TZWxlY3QubWFzdGVyKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSGlkZSBhbnkgb3B0aW9ucyBpbiB0aGUgY2FuZGlkYXRlIGxpc3Qgd2hpY2ggYXJlIGFscmVhZHkgc2VsZWN0ZWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgJChjb2x1bW5TZWxlY3QubWFzdGVyLmNhbmRpZGF0ZUNvbnRyb2wpLmZpbmQoXCJvcHRpb25cIikuZWFjaChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGhpc1NlbGVjdGVkID0gJCh0aGlzKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoY29sdW1uU2VsZWN0Lm1hc3Rlci5yZXN1bHRDb250cm9sKS5maW5kKFwib3B0aW9uXCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkKHRoaXMpLmh0bWwoKSA9PT0gdGhpc1NlbGVjdGVkLmh0bWwoKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzU2VsZWN0ZWQucmVtb3ZlKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBHaXBBZGRTZWxlY3RlZEl0ZW1zKGNvbHVtblNlbGVjdC5tYXN0ZXIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBTZXQgbWFzdGVyLmRhdGEgdG8gdGhlIG5ld2x5IGFsbG93YWJsZSB2YWx1ZXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uU2VsZWN0Lm1hc3Rlci5kYXRhID0gR2lwR2V0R3JvdXBEYXRhKG5ld011bHRpTG9va3VwUGlja2VyZGF0YSk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUcmlnZ2VyIGEgZGJsY2xpY2sgc28gdGhhdCB0aGUgY2hpbGQgd2lsbCBiZSBjYXNjYWRlZCBpZiBpdCBpcyBhIG11bHRpc2VsZWN0LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAkKGNvbHVtblNlbGVjdC5tYXN0ZXIuY2FuZGlkYXRlQ29udHJvbCkudHJpZ2dlcihcImRibGNsaWNrXCIpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgICAvLy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IgdGhpc0RhdGEgPSAkKHRoaXMpLmZpbmQoXCJkaXZbZGF0YV1cIikuYXR0cihcImRhdGFcIik7XHJcblxyXG4gICAgICAgICAgICB2YXIgZGljdGlvbmFyeUVudHJ5ID0ge307XHJcblxyXG4gICAgICAgICAgICAvLyBFbnRpdHkgZGF0YSBpcyBvbmx5IGF2YWlsYWJsZSBpbiBJRVxyXG4gICAgICAgICAgICBpZiAodHlwZW9mIHRoaXNEYXRhICE9PSBcInVuZGVmaW5lZFwiKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgYXJyYXlPZkRpY3Rpb25hcnlFbnRyeSA9ICQucGFyc2VYTUwodGhpc0RhdGEpO1xyXG4gICAgICAgICAgICAgICAgdmFyICR4bWwgPSAkKGFycmF5T2ZEaWN0aW9uYXJ5RW50cnkpO1xyXG5cclxuICAgICAgICAgICAgICAgICR4bWwuZmluZChcIkRpY3Rpb25hcnlFbnRyeVwiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIga2V5ID0gJCh0aGlzKS5maW5kKFwiS2V5XCIpLnRleHQoKTtcclxuICAgICAgICAgICAgICAgICAgICBkaWN0aW9uYXJ5RW50cnlba2V5XSA9ICQodGhpcykuZmluZChcIlZhbHVlXCIpLnRleHQoKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgZGljdGlvbmFyeUVudHJpZXMucHVzaChkaWN0aW9uYXJ5RW50cnkpO1xyXG4gICAgICAgICAgICAgICAgLy8gRm9yIG90aGVyIGJyb3dzZXJzLCB3ZSdsbCBjYWxsIEdldFVzZXJJbmZvIHRvIGdldCB0aGUgZGF0YVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgJCgpLlNQU2VydmljZXMoe1xyXG4gICAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbjogXCJHZXRVc2VySW5mb1wiLFxyXG4gICAgICAgICAgICAgICAgICAgIGFzeW5jOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgICAgICBjYWNoZVhNTDogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICB1c2VyTG9naW5OYW1lOiAkKHRoaXMpLmF0dHIoXCJ0aXRsZVwiKSxcclxuICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZWZ1bmM6IGZ1bmN0aW9uICh4RGF0YSkge1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgJCh4RGF0YS5yZXNwb25zZVhNTCkuZmluZChcIlVzZXJcIikuZWFjaChmdW5jdGlvbiAoKSB7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJC5lYWNoKHRoaXMuYXR0cmlidXRlcywgZnVuY3Rpb24gKGksIGF0dHJpYikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpY3Rpb25hcnlFbnRyeVthdHRyaWIubmFtZV0gPSBhdHRyaWIudmFsdWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpY3Rpb25hcnlFbnRyaWVzLnB1c2goZGljdGlvbmFyeUVudHJ5KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgcm93OiB0aGlzUm93LFxyXG4gICAgICAgICAgICBjb250ZW50czogdGhpc0NvbnRlbnRzLFxyXG4gICAgICAgICAgICBjdXJyZW50VmFsdWU6IHRoaXNDdXJyZW50VmFsdWUsXHJcbiAgICAgICAgICAgIGNoZWNrTmFtZXM6IHRoaXNDaGVja05hbWVzLFxyXG4gICAgICAgICAgICBkaWN0aW9uYXJ5RW50cmllczogZGljdGlvbmFyeUVudHJpZXNcclxuICAgICAgICB9O1x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B0cnVlLFxyXG4gICAgICAgICAgICBsaXN0TmFtZTogJCgpLlNQU2VydmljZXMuU1BMaXN0TmFtZUZyb21VcmwoKSxcclxuICAgICAgICAgICAgY29tcGxldGVmdW5jOiBmdW5jdGlvbiAoeERhdGEpIHtcclxuICAgICAgICAgICAgICAgICQoeERhdGEucmVzcG9uc2VYTUwpLmZpbmQoXCJGaWVsZFtEaXNwbGF5TmFtZT0nXCIgKyBvcHQubG9va3VwQ29sdW1uICsgXCInXVwiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICBsb29rdXBDb2x1bW5TdGF0aWNOYW1lID0gJCh0aGlzKS5hdHRyKFwiU3RhdGljTmFtZVwiKTtcclxuICAgICAgICAgICAgICAgICAgICAvLyBVc2UgR2V0TGlzdCBmb3IgdGhlIExvb2t1cCBjb2x1bW4ncyBsaXN0IHRvIGRldGVybWluZSB0aGUgbGlzdCdzIFVSTFxyXG4gICAgICAgICAgICAgICAgICAgICQoKS5TUFNlcnZpY2VzKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcIkdldExpc3RcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgYXN5bmM6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWNoZVhNTDogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdE5hbWU6ICQodGhpcykuYXR0cihcIkxpc3RcIiksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRlZnVuYzogZnVuY3Rpb24gKHhEYXRhKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKHhEYXRhLnJlc3BvbnNlWE1MKS5maW5kKFwiTGlzdFwiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb29rdXBMaXN0VXJsID0gJCh0aGlzKS5hdHRyKFwiV2ViRnVsbFVybFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOZWVkIHRvIGhhbmRsZSB3aGVuIGxpc3QgaXMgaW4gdGhlIHJvb3Qgc2l0ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvb2t1cExpc3RVcmwgPSBsb29rdXBMaXN0VXJsICE9PSBjb25zdGFudHMuU0xBU0ggPyBsb29rdXBMaXN0VXJsICsgY29uc3RhbnRzLlNMQVNIIDogbG9va3VwTGlzdFVybDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gR2V0IHRoZSBOZXdJdGVtIGZvcm0gZm9yIHRoZSBMb29rdXAgY29sdW1uJ3MgbGlzdFxyXG4gICAgICAgICAgICAgICAgICAgIG5ld1VybCA9IHV0aWxzLmdldExpc3RGb3JtVXJsKCQodGhpcykuYXR0cihcIkxpc3RcIiksIFwiTmV3Rm9ybVwiKTtcclxuICAgICAgICAgICAgICAgICAgICAvLyBTdG9wIGxvb2tpbmc7d2UncmUgZG9uZVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcblxyXG4gICAgICAgIGlmIChsb29rdXBMaXN0VXJsLmxlbmd0aCA9PT0gMCAmJiBvcHQuZGVidWcpIHtcclxuICAgICAgICAgICAgdXRpbHMuZXJyQm94KHRoaXNGdW5jdGlvbiwgXCJsb29rdXBDb2x1bW46IFwiICsgb3B0Lmxvb2t1cENvbHVtbiwgXCJUaGlzIGNvbHVtbiBkb2VzIG5vdCBhcHBlYXIgdG8gYmUgYSBsb29rdXAgY29sdW1uXCIpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgI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1ZXJ5U3RyaW5nVmFscy5Tb3VyY2UgPT09IFwic3RyaW5nXCIpID9cclxuICAgICAgICAgICAgICAgIFwiU291cmNlPVwiICsgcXVlcnlTdHJpbmdWYWxzLlNvdXJjZS5yZXBsYWNlKC9cXC8vZywgXCIlMmZcIikucmVwbGFjZSgvOi9nLCBcIiUzYVwiKSA6IFwiXCI7XHJcblxyXG4gICAgICAgICAgICAgICAgdmFyIG5ld1FTID0gW107XHJcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIFFTTGlzdCAhPT0gXCJ1bmRlZmluZWRcIikge1xyXG4gICAgICAgICAgICAgICAgICAgIG5ld1FTLnB1c2goXCJMaXN0PVwiICsgUVNMaXN0KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgUVNSb290Rm9sZGVyICE9PSBcInVuZGVmaW5lZFwiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV3UVMucHVzaChcIlJvb3RGb2xkZXI9XCIgKyBRU1Jvb3RGb2xkZXIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBRU0NvbnRlbnRUeXBlSWQgIT09IFwidW5kZWZpbmVkXCIpIHtcclxuICAgICAgICAgICAgICAgICAgICBuZXdRUy5wdXNoKFwiQ29udGVudFR5cGVJZD1cIiArIFFTQ29udGVudFR5cGVJZCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgdmFyIG5ld0FjdGlvbiA9IHRoaXNVcmwgK1xyXG4gICAgICAgICAgICAgICAgICAgICgobmV3UVMubGVuZ3RoID4gMCkgPyAoXCI/XCIgKyBuZXdRUy5qb2luKFwiJlwiKSArIFwiJlwiKSA6IFwiP1wiKSArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNldCB0aGUgU291cmNlIHRvIHBvaW50IGJhY2sgdG8gdGhpcyBwYWdlIHdpdGggdGhl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3NfSURcIikgIT09IHRoaXNJRCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtblZhbHVlSURzLnB1c2goWyQodGhpcykuYXR0cihcIm93c19JRFwiKSwgJCh0aGlzKS5hdHRyKFwib3dzX1wiICsgb3B0LmNvbHVtblN0YXRpY05hbWUpXSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIHZhciBuZXdNc2cgPSBvcHQuaW5pdE1zZztcclxuICAgICAgICAgICAgdmFyIG1zZ0NvbnRhaW5lciA9ICQoXCIjU1BSZXF1aXJlVW5pcXVlXCIgKyBvcHQuY29sdW1uU3RhdGljTmFtZSk7XHJcbiAgICAgICAgICAgIG1zZ0NvbnRhaW5lci5odG1sKG5ld01zZykuYXR0cihcImNsYXNzXCIsIG9wdC5pbml0TXNnQ1NTQ2xhc3MpO1xyXG5cclxuICAgICAgICAgICAgJChcImlucHV0W3ZhbHVlPSdPSyddOmRpc2FibGVkLCBpbnB1dFt2YWx1ZT0nU2F2ZSddOmRpc2FibGVkXCIpLnJlbW92ZUF0dHIoXCJkaXNhYmxlZFwiKTtcclxuICAgICAgICAgICAgaWYgKGNvbHVtblZhbHVlSURzLmxlbmd0aCA+IDApIHtcclxuICAgICAgICAgICAgICAgIG5ld01zZyA9IG9wdC5lcnJNc2c7XHJcbiAgICAgICAgICAgICAgICBtc2dDb250YWluZXIuaHRtbChuZXdNc2cpLmF0dHIoXCJjbGFzc1wiLCBvcHQuZXJyTXNnQ1NTQ2xhc3MpO1xyXG4gICAgICAgICAgICAgICAgaWYgKG9wdC5kdXBsaWNhdGVBY3Rpb24gPT09IDEpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb2x1bW5PYmouZm9jdXMoKTtcclxuICAgICAgICAgICAgICAgICAgICAkKFwiaW5wdXRbdmFsdWU9J09LJ10sIGlucHV0W3ZhbHVlPSdTYXZlJ11cIikuYXR0cihcImRpc2FibGVkXCIsIFwiZGlzYWJsZWRcIik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAob3B0LnNob3dEdXBlcykge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBvdXQgPSBcIiBcIiArIGNvbHVtblZhbHVlSURzLmxlbmd0aCArIFwiIGR1cGxpY2F0ZSBpdGVtXCIgKyAoY29sdW1uVmFsdWVJRHMubGVuZ3RoID4gMSA/IFwic1wiIDogXCJcIikgKyBcIjogXCI7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb2x1bW5WYWx1ZUlEcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdXQgKz0gXCI8YSBocmVmPSdEaXNwRm9ybS5hc3B4P0lEPVwiICsgY29sdW1uVmFsdWVJRHNbaV1bMF0gKyBcIiZTb3VyY2U9XCIgKyBsb2NhdGlvbi5ocmVmICsgXCInPlwiICsgY29sdW1uVmFsdWVJRHNbaV1bMV0gKyBcIjwvYT4gXCI7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICQoXCJzcGFuI1NQUmVxdWlyZVVuaXF1ZVwiICsgb3B0LmNvbHVtblN0YXRpY05hbWUpLmFwcGVuZChvdXQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIC8vIElmIHByZXNlbnQsIGNhbGwgY29tcGxldGVmdW5jIHdoZW4gYWxsIGVsc2UgaXMgZG9uZVxyXG4gICAgICAgIGlmIChvcHQuY29tcGxldGVmdW5jICE9PSBudWxsKSB7XHJcbiAgICAgICAgICAgIG9wdC5jb21wbGV0ZWZ1bmMoKTtcclxuICAgICAgICB9XHJcbiAgICB9OyAvLyBFbmQgJC5m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1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG9uJ3Qgd29yayB3aXRoIGhpZGRlbiBsaXN0cyB1bmxlc3Mgd2UncmUgYXNrZWQgdG9cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgob3B0LnNob3dIaWRkZW5MaXN0cyAmJiBsaXN0WG1sLmF0dHIoXCJIaWRkZW5cIikgPT09IFwiRmFsc2VcIikgfHwgIW9wdC5zaG93SGlkZGVuTGlzdHMpIHtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQXVkaXQgdGhlIGxpc3QncyBmb3Jtc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHQuYXVkaXRGb3Jtcykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBHZXQgdGhlIGxpc3QncyBDb250ZW50IFR5cGVzLCB0aGVyZWZvcmUgdGhlIGZvcm0gcGFnZXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCgpLlNQU2VydmljZXMoe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcIkdldExpc3RDb250ZW50VHlwZXNcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlYlVSTDogb3B0LndlYlVSTCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3ROYW1lOiBsaXN0WG1sLmF0dHIoXCJJRFwiKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzeW5jOiBmYWxzZSwgLy8gTmVlZCB0aGlzIHRvIGJlIHN5bmNocm9ub3VzIHNvIHdlJ3JlIGFzc3VyZWQgb2YgYSB2YWxpZCB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcGxldGVmdW5jOiBmdW5jdGlvbiAoeERhdGEpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKHhEYXRhLnJlc3BvbnNlWE1MKS5maW5kKFwiQ29udGVudFR5cGVcIikuZWFjaChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IGRlYWwgd2l0aCBmb2xkZXJzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkKHRoaXMpLmF0dHIoXCJJRFwiKS5zdWJzdHJpbmcoMCwgNikgIT09IFwiMHgwMTIwXCIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb3JtVXJscyA9ICQodGhpcykuZmluZChcIkZvcm1VcmxzXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmb3JtVHlwZXMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMb29rIGZvciBhIGN1c3RvbWl6ZWQgZm9ybS4uLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoZm9ybVVybHMpLmZpbmQoZm9ybVR5cGVzW2ldWzBdKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1BTY3JpcHRBdWRpdFBhZ2Uob3B0LCBsaXN0WG1sLCBcIkZvcm1cIiwgdGhpcy5ub2RlTmFtZSwgKChvcHQud2ViVVJMLmxlbmd0aCA+IDApID8gb3B0LndlYlVSTCA6ICQoKS5TUFNlcnZpY2VzLlNQR2V0Q3VycmVudFNpdGUoKSkgKyBjb25zdGFudHMuU0xBU0ggKyAkKHRoaXMpLnRleHQoKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1UeXBlc1tpXVsyXSA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gLi4uZWxzZSB0aGUgdW5jdXN0b21pemVkIGZvcm1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWZvcm1UeXBlc1tpXVsyXSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGVmYXVsdFZpZXdVcmwgPSBsaXN0WG1sLmF0dHIoXCJEZWZhdWx0Vmlld1VybFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1BTY3JpcHRBdWRpdFBhZ2Uob3B0LCBsaXN0WG1sLCBcIkZvcm1cIiwgZm9ybVR5cGVzW2ldWzBdLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZpZXdVcmwuc3Vic3RyaW5nKDAsIGRlZmF1bHRWaWV3VXJsLmxhc3RJbmRleE9mKGNvbnN0YW50cy5TTEFTSCkgKyAxKSArIGZvcm1UeXBlc1tpXVsxXSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVzZXQgdGhlIGZvcm0gdHlwZXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBmb3JtVHlwZXMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtVHlwZXNbaV1bMl0gPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEF1ZGl0IHRoZSBsaXN0J3Mgdmlld3NcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0LmF1ZGl0Vmlld3MpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gR2V0IHRoZSBsaXN0J3MgVmlld3NcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCgpLlNQU2VydmljZXMoe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcIkdldFZpZXdDb2xsZWN0aW9uXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWJVUkw6IG9wdC53ZWJVUkwsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0TmFtZTogbGlzdFhtbC5hdHRyKFwiSURcIiksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhc3luYzogZmFsc2UsIC8vIE5lZWQgdGhpcyB0byBiZSBzeW5jaHJvbm91cyBzbyB3ZSdyZSBhc3N1cmVkIG9mIGEgdmFsaWQgdmFsdWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRlZnVuYzogZnVuY3Rpb24gKHhEYXRhKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCh4RGF0YS5yZXNwb25zZVhNTCkuZmluZChcIlZpZXdcIikuZWFjaChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNQU2NyaXB0QXVkaXRQYWdlKG9wdCwgbGlzdFhtbCwgXCJWaWV3XCIsICQodGhpcykuYXR0cihcIkRpc3BsYXlOYW1lXCIpLCAkKHRoaXMpLmF0dHIoXCJVcmxcIikpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gRG9uJ3QgYm90aGVyIHdpdGggYXVkaXRpbmcgcGFnZXMgaWYgdGhlIG9wdGlvbnMgZG9uJ3QgcmVxdWlyZSBpdFxyXG4gICAgICAgIHZhciBudW1MaXN0cyA9IDA7XHJcbiAgICAgICAgdmFyIGxpc3RzQXJyYXkgPSBbXTtcclxuICAgICAgICBpZiAodHlwZW9mIG9wdC5hdWRpdFBhZ2VzTGlzdE5hbWUgPT09IFwic3RyaW5nXCIpIHtcclxuICAgICAgICAgICAgbnVtTGlzdHMgPSAxO1xyXG4gICAgICAgICAgICBsaXN0c0FycmF5LnB1c2gob3B0LmF1ZGl0UGFnZXNMaXN0TmFtZSk7XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgbnVtTGlzdHMgPSBvcHQuYXVkaXRQYWdlc0xpc3ROYW1lLmxlbmd0aDtcclxuICAgICAgICAgICAgbGlzdHNBcnJheSA9IG9wdC5hdWRpdFBhZ2VzTGlzdE5hbWU7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAob3B0LmF1ZGl0UGFnZXMpIHtcclxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBudW1MaXN0czsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICAkKCkuU1BTZXJ2aWNlcyh7XHJcbiAgICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcIkdldExpc3RcIixcclxuICAgICAgICAgICAgICAgICAgICBhc3luYzogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAgICAgY2FjaGVYTUw6IHRydWUsXHJcbiAgICAgICAgICAgICAgICAgICAgd2ViVVJMOiBvcHQud2ViVVJMLFxyXG4gICAgICAgICAgICAgICAgICAgIGxpc3ROYW1lOiBsaXN0c0FycmF5W2ldLFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbXBsZXRlZnVuYzogZnVuY3Rpb24gKHhEYXRhKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICQoeERhdGEucmVzcG9uc2VYTUwpLmZpbmQoXCJMaXN0XCIpLmVhY2goZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFhtbCA9ICQodGhpcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgLy8gR2V0IGFsbCBvZiB0aGUgaXRlbXMgZnJvbSB0aGUgRG9jdW1lbnQgTGlicmFyeVxyXG4gICAgICAgICAgICAgICAgJCgpLlNQU2VydmljZXMoe1xyXG4gICAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbjogXCJHZXRMaXN0SXRlbXNcIixcclxuICAgICAgICAgICAgICAgICAgICBhc3luYzogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAgICAgd2ViVVJMOiBvcHQud2ViVVJMLFxyXG4gICAgICAgICAgICAgICAgICAgIGxpc3ROYW1lOiBsaXN0c0FycmF5W2ldLFxyXG4gICAgICAgICAgICAgICAgICAgIENBTUxRdWVyeTogXCI8UXVlcnk+PFdoZXJlPjxOZXE+PEZpZWxkUmVmIE5hbWU9J0NvbnRlbnRUeXBlJy8+PFZhbHVlIFR5cGU9J1RleHQnPkZvbGRlcjwvVmFsdWU+PC9OZXE+PC9XaGVyZT48L1F1ZXJ5PlwiLFxyXG4gICAgICAgICAgICAgICAgICAgIENBTUxWaWV3RmllbGRzOiBcIjxWaWV3RmllbGRzPjxGaWVsZFJlZiBOYW1lPSdUaXRsZScvPjxGaWVsZFJlZiBOYW1lPSdGaWxlUmVmJy8+PC9WaWV3RmllbGRzPlwiLFxyXG4gICAgICAgICAgICAgICAgICAgIENBTUxSb3dMaW1pdDogMCxcclxuICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZWZ1bmM6IGZ1bmN0aW9uICh4RGF0YSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAkKHhEYXRhLnJlc3BvbnNlWE1MKS5TUEZpbHRlck5vZGUoXCJ6OnJvd1wiKS5lYWNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aGlzUGFnZVVybCA9ICQodGhpcykuYXR0cihcIm93c19GaWxlUmVmXCIpLnNwbGl0KGNvbnN0YW50cy5zcERlbGltKVsxXTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aGlzVGl0bGUgPSAkKHRoaXMpLmF0dHIoXCJvd3NfVGl0bGVcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGhpc1BhZ2VUeXBlID0gKHR5cGVvZiB0aGlzVGl0bGUgIT09IFwidW5kZWZpbmVkXCIpID8gdGhpc1RpdGxlIDogXCJcIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzUGFnZVVybC5pbmRleE9mKFwiLmFzcHhcIikgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1BTY3JpcHRBdWRpdFBhZ2Uob3B0LCBsaXN0WG1sLCBcIlBhZ2VcIiwgdGhpc1BhZ2VUeXBlLCBjb25zdGFudHMuU0xBU0ggKyB0aGlzUGFnZVVybCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vIFJlbW92ZSBwcm9ncmVzcyBpbmRpY2F0b3IgYW5kIG1ha2UgdGhlIG91dHB1dCBwcmV0dHkgYnkgY2xlYW5pbmcgdXAgdGhlIG1zLWFsdGVybmF0aW5nIENTUyBjbGFzc1xyXG4gICAgICAgIHNjcmlwdEF1ZGl0Q29udGFpbmVyLmZpbmQoXCJ0cltjbGFzcz0nbXMtYWx0ZXJuYXRpbmcnXTpldmVuXCIpLnJlbW92ZUF0dHIoXCJjbGFzc1wiKTtcclxuICAgIH07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0LlxyXG4gICAgICAgIHZhciBkaXZXaWR0aCA9IGNsb25lT2JqLndpZHRoKCkgKyA1O1xyXG4gICAgICAgIHZhciBuZXdEaXZXaWR0aCA9IGRpdldpZHRoO1xyXG4gICAgICAgIGlmIChvcHQubWluV2lkdGggPiAwIHx8IG9wdC5tYXhXaWR0aCA+IDApIHtcclxuICAgICAgICAgICAgaWYgKGRpdldpZHRoIDwgb3B0Lm1pbldpZHRoKSB7XHJcbiAgICAgICAgICAgICAgICBkaXZXaWR0aCA9IG9wdC5taW5XaWR0aDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAobmV3RGl2V2lkdGggPCBvcHQubWluV2lkdGgpIHtcclxuICAgICAgICAgICAgICAgIG5ld0RpdldpZHRoID0gb3B0Lm1pbldpZHRoO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChuZXdEaXZXaWR0aCA+IG9wdC5tYXhXaWR0aCkge1xyXG4gICAgICAgICAgICAgICAgbmV3RGl2V2lkdGggPSBvcHQubWF4V2lkdGg7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIHNlbGVjdFdpZHRoID0gZGl2V2lkdGg7XHJcblxyXG4gICAgICAgIC8vIFNldCB0aGUgbmV3IHdpZHRoc1xyXG4gICAgICAgICQodGhpc011bHRpU2VsZWN0Lm1hc3Rlci5jYW5kaWRhdGVDb250cm9sKS5jc3MoXCJ3aWR0aFwiLCBzZWxlY3RXaWR0aCArIFwicHhcIikucGFyZW50KCkuY3NzKFwid2lkdGhcIiwgbmV3RGl2V2lkdGggKyBcInB4XCIpO1xyXG4gICAgICAgICQodGhpc011bHRpU2VsZWN0Lm1hc3Rlci5yZXN1bHRDb250cm9sKS5jc3MoXCJ3aWR0aFwiLCBzZWxlY3RXaWR0aCArIFwicHhcIikucGFyZW50KCkuY3NzKFwid2lkdGhcIiwgbmV3RGl2V2lkdGggKyBcInB4XCIpO1xyXG5cclxuICAg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cIjwvQmF0Y2g+XCI7XHJcblxyXG4gICAgICAgIC8vIENhbGwgVXBkYXRlTGlzdEl0ZW1zIHRvIHVwZGF0ZSBhbGwgb2YgdGhlIGl0ZW1zIG1hdGNoaW5nIHRoZSBDQU1MUXVlcnlcclxuICAgICAgICAkKCkuU1BTZXJ2aWNlcyh7XHJcbiAgICAgICAgICAgIG9wZXJhdGlvbjogXCJVcGRhdGVMaXN0SXRlbXNcIixcclxuICAgICAgICAgICAgYXN5bmM6IGZhbHNlLFxyXG4gICAgICAgICAgICB3ZWJVUkw6IG9wdC53ZWJVUkwsXHJcbiAgICAgICAgICAgIGxpc3ROYW1lOiBvcHQubGlzdE5hbWUsXHJcbiAgICAgICAgICAgIHVwZGF0ZXM6IGJhdGNoLFxyXG4gICAgICAgICAgICBjb21wbGV0ZWZ1bmM6IGZ1bmN0aW9uICh4RGF0YSkge1xyXG4gICAgICAgICAgICAgICAgLy8gSWYgcHJlc2VudCwgY2FsbCBjb21wbGV0ZWZ1bmMgd2hlbiBhbGwgZWxzZSBpcyBkb25lXHJcbiAgICAgICAgICAgICAgICBpZiAob3B0LmNvbXBsZXRlZnVuYyAhPT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIG9wdC5jb21wbGV0ZWZ1bmMoeERhdGEpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcblxyXG4gICAgfTsgLy8gRW5kICQuZm4uU1BTZXJ2aWNlcy5TUFVwZGF0ZU11bHRpcGxlTGlzdEl0ZW1zXHJcblxyXG4gICAgcmV0dXJuICQ7XHJcblxyXG59KTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0= diff --git a/build/jQuery.SPServices-2.0.0-pre-alpha.min.js b/build/jQuery.SPServices-2.0.0-pre-alpha.min.js new file mode 100644 index 0000000..4273fd2 --- /dev/null +++ b/build/jQuery.SPServices-2.0.0-pre-alpha.min.js @@ -0,0 +1,4 @@ +!function(e){function t(o){if(a[o])return a[o].exports;var r=a[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}([function(e,t,a){a(1),a(4),a(5),a(3),a(6),a(7),a(8),a(9),a(10),a(11),a(12),a(13),a(14),a(15),a(16),a(17),a(18),a(19),a(20),a(21),a(22),a(23),a(24),a(25),a(26),a(27),a(28),a(29),a(30),a(31),e.exports=a(32)},function(e,t,a){var o,r;o=[a(2),a(3),a(4)],r=function(e,t,a){"use strict";var o="",r={header:"",footer:"",payload:""},i={},s={ALERTS:"Alerts",AUTHENTICATION:"Authentication",COPY:"Copy",FORMS:"Forms",LISTS:"Lists",MEETINGS:"Meetings",OFFICIALFILE:"OfficialFile",PEOPLE:"People",PERMISSIONS:"Permissions",PUBLISHEDLINKSSERVICE:"PublishedLinksService",SEARCH:"Search",SHAREPOINTDIAGNOSTICS:"SharePointDiagnostics",SITEDATA:"SiteData",SITES:"Sites",SOCIALDATASERVICE:"SocialDataService",SPELLCHECK:"SpellCheck",TAXONOMYSERVICE:"TaxonomyClientService",USERGROUP:"usergroup",USERPROFILESERVICE:"UserProfileService",VERSIONS:"Versions",VIEWS:"Views",WEBPARTPAGES:"WebPartPages",WEBS:"Webs",WORKFLOW:"Workflow",NINTEXWORKFLOW:"NintexWorkflow/Workflow"},n=["listName","description"],l={};l.GetAlerts=[s.ALERTS,!1],l.DeleteAlerts=[s.ALERTS,!0],l.Mode=[s.AUTHENTICATION,!1],l.Login=[s.AUTHENTICATION,!1],l.CopyIntoItems=[s.COPY,!0],l.CopyIntoItemsLocal=[s.COPY,!0],l.GetItem=[s.COPY,!1],l.GetForm=[s.FORMS,!1],l.GetFormCollection=[s.FORMS,!1],l.AddAttachment=[s.LISTS,!0],l.AddDiscussionBoardItem=[s.LISTS,!0],l.AddList=[s.LISTS,!0],l.AddListFromFeature=[s.LISTS,!0],l.ApplyContentTypeToList=[s.LISTS,!0],l.CheckInFile=[s.LISTS,!0],l.CheckOutFile=[s.LISTS,!0],l.CreateContentType=[s.LISTS,!0],l.DeleteAttachment=[s.LISTS,!0],l.DeleteContentType=[s.LISTS,!0],l.DeleteContentTypeXmlDocument=[s.LISTS,!0],l.DeleteList=[s.LISTS,!0],l.GetAttachmentCollection=[s.LISTS,!1],l.GetList=[s.LISTS,!1],l.GetListAndView=[s.LISTS,!1],l.GetListCollection=[s.LISTS,!1],l.GetListContentType=[s.LISTS,!1],l.GetListContentTypes=[s.LISTS,!1],l.GetListItemChanges=[s.LISTS,!1],l.GetListItemChangesSinceToken=[s.LISTS,!1],l.GetListItems=[s.LISTS,!1],l.GetVersionCollection=[s.LISTS,!1],l.UndoCheckOut=[s.LISTS,!0],l.UpdateContentType=[s.LISTS,!0],l.UpdateContentTypesXmlDocument=[s.LISTS,!0],l.UpdateContentTypeXmlDocument=[s.LISTS,!0],l.UpdateList=[s.LISTS,!0],l.UpdateListItems=[s.LISTS,!0],l.AddMeeting=[s.MEETINGS,!0],l.CreateWorkspace=[s.MEETINGS,!0],l.RemoveMeeting=[s.MEETINGS,!0],l.SetWorkSpaceTitle=[s.MEETINGS,!0],l.GetRecordRouting=[s.OFFICIALFILE,!1],l.GetRecordRoutingCollection=[s.OFFICIALFILE,!1],l.GetServerInfo=[s.OFFICIALFILE,!1],l.SubmitFile=[s.OFFICIALFILE,!0],l.ResolvePrincipals=[s.PEOPLE,!0],l.SearchPrincipals=[s.PEOPLE,!1],l.AddPermission=[s.PERMISSIONS,!0],l.AddPermissionCollection=[s.PERMISSIONS,!0],l.GetPermissionCollection=[s.PERMISSIONS,!0],l.RemovePermission=[s.PERMISSIONS,!0],l.RemovePermissionCollection=[s.PERMISSIONS,!0],l.UpdatePermission=[s.PERMISSIONS,!0],l.GetLinks=[s.PUBLISHEDLINKSSERVICE,!0],l.GetPortalSearchInfo=[s.SEARCH,!1],l.GetQuerySuggestions=[s.SEARCH,!1],l.GetSearchMetadata=[s.SEARCH,!1],l.Query=[s.SEARCH,!1],l.QueryEx=[s.SEARCH,!1],l.Registration=[s.SEARCH,!1],l.Status=[s.SEARCH,!1],l.SendClientScriptErrorReport=[s.SHAREPOINTDIAGNOSTICS,!0],l.GetAttachments=[s.SITEDATA,!1],l.EnumerateFolder=[s.SITEDATA,!1],l.SiteDataGetList=[s.SITEDATA,!1],l.SiteDataGetListCollection=[s.SITEDATA,!1],l.SiteDataGetSite=[s.SITEDATA,!1],l.SiteDataGetSiteUrl=[s.SITEDATA,!1],l.SiteDataGetWeb=[s.SITEDATA,!1],l.CreateWeb=[s.SITES,!0],l.DeleteWeb=[s.SITES,!0],l.GetSite=[s.SITES,!1],l.GetSiteTemplates=[s.SITES,!1],l.AddComment=[s.SOCIALDATASERVICE,!0],l.AddTag=[s.SOCIALDATASERVICE,!0],l.AddTagByKeyword=[s.SOCIALDATASERVICE,!0],l.CountCommentsOfUser=[s.SOCIALDATASERVICE,!1],l.CountCommentsOfUserOnUrl=[s.SOCIALDATASERVICE,!1],l.CountCommentsOnUrl=[s.SOCIALDATASERVICE,!1],l.CountRatingsOnUrl=[s.SOCIALDATASERVICE,!1],l.CountTagsOfUser=[s.SOCIALDATASERVICE,!1],l.DeleteComment=[s.SOCIALDATASERVICE,!0],l.DeleteRating=[s.SOCIALDATASERVICE,!0],l.DeleteTag=[s.SOCIALDATASERVICE,!0],l.DeleteTagByKeyword=[s.SOCIALDATASERVICE,!0],l.DeleteTags=[s.SOCIALDATASERVICE,!0],l.GetAllTagTerms=[s.SOCIALDATASERVICE,!1],l.GetAllTagTermsForUrlFolder=[s.SOCIALDATASERVICE,!1],l.GetAllTagUrls=[s.SOCIALDATASERVICE,!1],l.GetAllTagUrlsByKeyword=[s.SOCIALDATASERVICE,!1],l.GetCommentsOfUser=[s.SOCIALDATASERVICE,!1],l.GetCommentsOfUserOnUrl=[s.SOCIALDATASERVICE,!1],l.GetCommentsOnUrl=[s.SOCIALDATASERVICE,!1],l.GetRatingAverageOnUrl=[s.SOCIALDATASERVICE,!1],l.GetRatingOfUserOnUrl=[s.SOCIALDATASERVICE,!1],l.GetRatingOnUrl=[s.SOCIALDATASERVICE,!1],l.GetRatingsOfUser=[s.SOCIALDATASERVICE,!1],l.GetRatingsOnUrl=[s.SOCIALDATASERVICE,!1],l.GetSocialDataForFullReplication=[s.SOCIALDATASERVICE,!1],l.GetTags=[s.SOCIALDATASERVICE,!0],l.GetTagsOfUser=[s.SOCIALDATASERVICE,!0],l.GetTagTerms=[s.SOCIALDATASERVICE,!0],l.GetTagTermsOfUser=[s.SOCIALDATASERVICE,!0],l.GetTagTermsOnUrl=[s.SOCIALDATASERVICE,!0],l.GetTagUrlsOfUser=[s.SOCIALDATASERVICE,!0],l.GetTagUrlsOfUserByKeyword=[s.SOCIALDATASERVICE,!0],l.GetTagUrls=[s.SOCIALDATASERVICE,!0],l.GetTagUrlsByKeyword=[s.SOCIALDATASERVICE,!0],l.SetRating=[s.SOCIALDATASERVICE,!0],l.UpdateComment=[s.SOCIALDATASERVICE,!0],l.SpellCheck=[s.SPELLCHECK,!1],l.AddTerms=[s.TAXONOMYSERVICE,!0],l.GetChildTermsInTerm=[s.TAXONOMYSERVICE,!1],l.GetChildTermsInTermSet=[s.TAXONOMYSERVICE,!1],l.GetKeywordTermsByGuids=[s.TAXONOMYSERVICE,!1],l.GetTermsByLabel=[s.TAXONOMYSERVICE,!1],l.GetTermSets=[s.TAXONOMYSERVICE,!1],l.AddGroup=[s.USERGROUP,!0],l.AddGroupToRole=[s.USERGROUP,!0],l.AddRole=[s.USERGROUP,!0],l.AddRoleDef=[s.USERGROUP,!0],l.AddUserCollectionToGroup=[s.USERGROUP,!0],l.AddUserCollectionToRole=[s.USERGROUP,!0],l.AddUserToGroup=[s.USERGROUP,!0],l.AddUserToRole=[s.USERGROUP,!0],l.GetAllUserCollectionFromWeb=[s.USERGROUP,!1],l.GetGroupCollection=[s.USERGROUP,!1],l.GetGroupCollectionFromRole=[s.USERGROUP,!1],l.GetGroupCollectionFromSite=[s.USERGROUP,!1],l.GetGroupCollectionFromUser=[s.USERGROUP,!1],l.GetGroupCollectionFromWeb=[s.USERGROUP,!1],l.GetGroupInfo=[s.USERGROUP,!1],l.GetRoleCollection=[s.USERGROUP,!1],l.GetRoleCollectionFromGroup=[s.USERGROUP,!1],l.GetRoleCollectionFromUser=[s.USERGROUP,!1],l.GetRoleCollectionFromWeb=[s.USERGROUP,!1],l.GetRoleInfo=[s.USERGROUP,!1],l.GetRolesAndPermissionsForCurrentUser=[s.USERGROUP,!1],l.GetRolesAndPermissionsForSite=[s.USERGROUP,!1],l.GetUserCollection=[s.USERGROUP,!1],l.GetUserCollectionFromGroup=[s.USERGROUP,!1],l.GetUserCollectionFromRole=[s.USERGROUP,!1],l.GetUserCollectionFromSite=[s.USERGROUP,!1],l.GetUserCollectionFromWeb=[s.USERGROUP,!1],l.GetUserInfo=[s.USERGROUP,!1],l.GetUserLoginFromEmail=[s.USERGROUP,!1],l.RemoveGroup=[s.USERGROUP,!0],l.RemoveGroupFromRole=[s.USERGROUP,!0],l.RemoveRole=[s.USERGROUP,!0],l.RemoveUserCollectionFromGroup=[s.USERGROUP,!0],l.RemoveUserCollectionFromRole=[s.USERGROUP,!0],l.RemoveUserCollectionFromSite=[s.USERGROUP,!0],l.RemoveUserFromGroup=[s.USERGROUP,!0],l.RemoveUserFromRole=[s.USERGROUP,!0],l.RemoveUserFromSite=[s.USERGROUP,!0],l.RemoveUserFromWeb=[s.USERGROUP,!0],l.UpdateGroupInfo=[s.USERGROUP,!0],l.UpdateRoleDefInfo=[s.USERGROUP,!0],l.UpdateRoleInfo=[s.USERGROUP,!0],l.UpdateUserInfo=[s.USERGROUP,!0],l.AddColleague=[s.USERPROFILESERVICE,!0],l.AddLink=[s.USERPROFILESERVICE,!0],l.AddMembership=[s.USERPROFILESERVICE,!0],l.AddPinnedLink=[s.USERPROFILESERVICE,!0],l.CreateMemberGroup=[s.USERPROFILESERVICE,!0],l.CreateUserProfileByAccountName=[s.USERPROFILESERVICE,!0],l.GetCommonColleagues=[s.USERPROFILESERVICE,!1],l.GetCommonManager=[s.USERPROFILESERVICE,!1],l.GetCommonMemberships=[s.USERPROFILESERVICE,!1],l.GetInCommon=[s.USERPROFILESERVICE,!1],l.GetPropertyChoiceList=[s.USERPROFILESERVICE,!1],l.GetUserColleagues=[s.USERPROFILESERVICE,!1],l.GetUserLinks=[s.USERPROFILESERVICE,!1],l.GetUserMemberships=[s.USERPROFILESERVICE,!1],l.GetUserPinnedLinks=[s.USERPROFILESERVICE,!1],l.GetUserProfileByGuid=[s.USERPROFILESERVICE,!1],l.GetUserProfileByIndex=[s.USERPROFILESERVICE,!1],l.GetUserProfileByName=[s.USERPROFILESERVICE,!1],l.GetUserProfileCount=[s.USERPROFILESERVICE,!1],l.GetUserProfileSchema=[s.USERPROFILESERVICE,!1],l.GetUserPropertyByAccountName=[s.USERPROFILESERVICE,!1],l.ModifyUserPropertyByAccountName=[s.USERPROFILESERVICE,!0],l.RemoveAllColleagues=[s.USERPROFILESERVICE,!0],l.RemoveAllLinks=[s.USERPROFILESERVICE,!0],l.RemoveAllMemberships=[s.USERPROFILESERVICE,!0],l.RemoveAllPinnedLinks=[s.USERPROFILESERVICE,!0],l.RemoveColleague=[s.USERPROFILESERVICE,!0],l.RemoveLink=[s.USERPROFILESERVICE,!0],l.RemoveMembership=[s.USERPROFILESERVICE,!0],l.RemovePinnedLink=[s.USERPROFILESERVICE,!0],l.UpdateColleaguePrivacy=[s.USERPROFILESERVICE,!0],l.UpdateLink=[s.USERPROFILESERVICE,!0],l.UpdateMembershipPrivacy=[s.USERPROFILESERVICE,!0],l.UpdatePinnedLink=[s.USERPROFILESERVICE,!0],l.DeleteAllVersions=[s.VERSIONS,!0],l.DeleteVersion=[s.VERSIONS,!0],l.GetVersions=[s.VERSIONS,!1],l.RestoreVersion=[s.VERSIONS,!0],l.AddView=[s.VIEWS,!0],l.DeleteView=[s.VIEWS,!0],l.GetView=[s.VIEWS,!1],l.GetViewHtml=[s.VIEWS,!1],l.GetViewCollection=[s.VIEWS,!1],l.UpdateView=[s.VIEWS,!0],l.UpdateViewHtml=[s.VIEWS,!0],l.AddWebPart=[s.WEBPARTPAGES,!0],l.AddWebPartToZone=[s.WEBPARTPAGES,!0],l.DeleteWebPart=[s.WEBPARTPAGES,!0],l.GetWebPart2=[s.WEBPARTPAGES,!1],l.GetWebPartPage=[s.WEBPARTPAGES,!1],l.GetWebPartProperties=[s.WEBPARTPAGES,!1],l.GetWebPartProperties2=[s.WEBPARTPAGES,!1],l.SaveWebPart2=[s.WEBPARTPAGES,!0],l.WebsCreateContentType=[s.WEBS,!0],l.GetColumns=[s.WEBS,!1],l.GetContentType=[s.WEBS,!1],l.GetContentTypes=[s.WEBS,!1],l.GetCustomizedPageStatus=[s.WEBS,!1],l.GetListTemplates=[s.WEBS,!1],l.GetObjectIdFromUrl=[s.WEBS,!1],l.GetWeb=[s.WEBS,!1],l.GetWebCollection=[s.WEBS,!1],l.GetAllSubWebCollection=[s.WEBS,!1],l.UpdateColumns=[s.WEBS,!0],l.WebsUpdateContentType=[s.WEBS,!0],l.WebUrlFromPageUrl=[s.WEBS,!1],l.AlterToDo=[s.WORKFLOW,!0],l.ClaimReleaseTask=[s.WORKFLOW,!0],l.GetTemplatesForItem=[s.WORKFLOW,!1],l.GetToDosForItem=[s.WORKFLOW,!1],l.GetWorkflowDataForItem=[s.WORKFLOW,!1],l.GetWorkflowTaskData=[s.WORKFLOW,!1],l.StartWorkflow=[s.WORKFLOW,!0],l.AddLongTermDelegationRule=[s.NINTEXWORKFLOW,!0],l.AddWorkflowSchedule=[s.NINTEXWORKFLOW,!0],l.AddWorkflowScheduleOnListItem=[s.NINTEXWORKFLOW,!0],l.CheckGlobalReuseStatus=[s.NINTEXWORKFLOW,!0],l.CheckInForms=[s.NINTEXWORKFLOW,!0],l.DelegateAllTasks=[s.NINTEXWORKFLOW,!0],l.DelegateTask=[s.NINTEXWORKFLOW,!0],l.DeleteLongTermDelegationRule=[s.NINTEXWORKFLOW,!0],l.DeleteSnippet=[s.NINTEXWORKFLOW,!0],l.DeleteWorkflow=[s.NINTEXWORKFLOW,!0],l.ExportWorkflow=[s.NINTEXWORKFLOW,!0],l.FixWorkflowsInSiteFromTemplate=[s.NINTEXWORKFLOW,!0],l.GetFolders=[s.NINTEXWORKFLOW,!0],l.GetItemsPendingMyApproval=[s.NINTEXWORKFLOW,!0],l.GetListContentTypes=[s.NINTEXWORKFLOW,!0],l.GetOutcomesForFlexiTask=[s.NINTEXWORKFLOW,!0],l.GetRunningWorkflowTasks=[s.NINTEXWORKFLOW,!0],l.GetRunningWorkflowTasksCollection=[s.NINTEXWORKFLOW,!0],l.GetRunningWorkflowTasksForCurrentUser=[s.NINTEXWORKFLOW,!0],l.GetRunningWorkflowTasksForCurrentUserForListItem=[s.NINTEXWORKFLOW,!0],l.GetRunningWorkflowTasksForListItem=[s.NINTEXWORKFLOW,!0],l.GetTaskDetailsUsingStub=[s.NINTEXWORKFLOW,!0],l.GetTaskStubsForCurrentUser=[s.NINTEXWORKFLOW,!0],l.GetWorkflowHistory=[s.NINTEXWORKFLOW,!0],l.GetWorkflowHistoryForListItem=[s.NINTEXWORKFLOW,!0],l.HideTaskForApprover=[s.NINTEXWORKFLOW,!0],l.HideWorkflow=[s.NINTEXWORKFLOW,!0],l.ProcessFlexiTaskResponse=[s.NINTEXWORKFLOW,!0],l.ProcessFlexiTaskResponse2=[s.NINTEXWORKFLOW,!0],l.ProcessTaskResponse=[s.NINTEXWORKFLOW,!0],l.ProcessTaskResponse2=[s.NINTEXWORKFLOW,!0],l.ProcessTaskResponse3=[s.NINTEXWORKFLOW,!0],l.ProcessTaskResponseUsingToken=[s.NINTEXWORKFLOW,!0],l.PublishFromNWF=[s.NINTEXWORKFLOW,!0],l.PublishFromNWFNoOverwrite=[s.NINTEXWORKFLOW,!0],l.PublishFromNWFSkipValidation=[s.NINTEXWORKFLOW,!0],l.PublishFromNWFSkipValidationNoOverwrite=[s.NINTEXWORKFLOW,!0],l.PublishFromNWFXml=[s.NINTEXWORKFLOW,!0],l.PublishFromNWFXmlNoOverwrite=[s.NINTEXWORKFLOW,!0],l.PublishFromNWFXmlSkipValidation=[s.NINTEXWORKFLOW,!0],l.PublishFromNWFXmlSkipValidationNoOverwrite=[s.NINTEXWORKFLOW,!0],l.PublishWorkflow=[s.NINTEXWORKFLOW,!0],l.QueryForMessages=[s.NINTEXWORKFLOW,!0],l.RemoveWorkflowSchedule=[s.NINTEXWORKFLOW,!0],l.RemoveWorkflowScheduleOnListItem=[s.NINTEXWORKFLOW,!0],l.SaveFromNWF=[s.NINTEXWORKFLOW,!0],l.SaveFromNWFNoOverwrite=[s.NINTEXWORKFLOW,!0],l.SaveFromNWFXml=[s.NINTEXWORKFLOW,!0],l.SaveFromNWFXmlNoOverwrite=[s.NINTEXWORKFLOW,!0],l.SaveSnippet=[s.NINTEXWORKFLOW,!0],l.SaveTemplate=[s.NINTEXWORKFLOW,!0],l.SaveTemplate2=[s.NINTEXWORKFLOW,!0],l.SaveWorkflow=[s.NINTEXWORKFLOW,!0],l.SnippetExists=[s.NINTEXWORKFLOW,!0],l.StartSiteWorkflow=[s.NINTEXWORKFLOW,!0],l.NintexStartWorkflow=[s.NINTEXWORKFLOW,!0],l.StartWorkflowOnListItem=[s.NINTEXWORKFLOW,!0],l.TemplateExists=[s.NINTEXWORKFLOW,!0],l.TerminateWorkflow=[s.NINTEXWORKFLOW,!0],l.TerminateWorkflowByName=[s.NINTEXWORKFLOW,!0],l.TerminateWorkflowByNameForListItem=[s.NINTEXWORKFLOW,!0],l.WorkflowExists=[s.NINTEXWORKFLOW,!0],l.WorkflowFormProductSelected=[s.NINTEXWORKFLOW,!0],e.fn.SPServices=function(d){for(var c=e.extend({},e.fn.SPServices.defaults,d),m=0;m",o=t.SCHEMASharePoint+"/soap/2002/1/alerts/";break;case s.MEETINGS:r.opheader+="xmlns='"+t.SCHEMASharePoint+"/soap/meetings/' >",o=t.SCHEMASharePoint+"/soap/meetings/";break;case s.OFFICIALFILE:r.opheader+="xmlns='"+t.SCHEMASharePoint+"/soap/recordsrepository/' >",o=t.SCHEMASharePoint+"/soap/recordsrepository/";break;case s.PERMISSIONS:r.opheader+="xmlns='"+t.SCHEMASharePoint+"/soap/directory/' >",o=t.SCHEMASharePoint+"/soap/directory/";break;case s.PUBLISHEDLINKSSERVICE:r.opheader+="xmlns='http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService/' >",o="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService/";break;case s.SEARCH:r.opheader+="xmlns='urn:Microsoft.Search' >",o="urn:Microsoft.Search/";break;case s.SHAREPOINTDIAGNOSTICS:r.opheader+="xmlns='"+t.SCHEMASharePoint+"/diagnostics/' >",o="http://schemas.microsoft.com/sharepoint/diagnostics/";break;case s.SOCIALDATASERVICE:r.opheader+="xmlns='http://microsoft.com/webservices/SharePointPortalServer/SocialDataService' >",o="http://microsoft.com/webservices/SharePointPortalServer/SocialDataService/";break;case s.SPELLCHECK:r.opheader+="xmlns='http://schemas.microsoft.com/sharepoint/publishing/spelling/' >",o="http://schemas.microsoft.com/sharepoint/publishing/spelling/SpellCheck";break;case s.TAXONOMYSERVICE:r.opheader+="xmlns='"+t.SCHEMASharePoint+"/taxonomy/soap/' >",o=t.SCHEMASharePoint+"/taxonomy/soap/";break;case s.USERGROUP:r.opheader+="xmlns='"+t.SCHEMASharePoint+"/soap/directory/' >",o=t.SCHEMASharePoint+"/soap/directory/";break;case s.USERPROFILESERVICE:r.opheader+="xmlns='http://microsoft.com/webservices/SharePointPortalServer/UserProfileService' >",o="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService/";break;case s.WEBPARTPAGES:r.opheader+="xmlns='http://microsoft.com/sharepoint/webpartpages' >",o="http://microsoft.com/sharepoint/webpartpages/";break;case s.WORKFLOW:r.opheader+="xmlns='"+t.SCHEMASharePoint+"/soap/workflow/' >",o=t.SCHEMASharePoint+"/soap/workflow/";break;default:r.opheader+="xmlns='"+t.SCHEMASharePoint+"/soap/'>",o=t.SCHEMASharePoint+"/soap/"}o+=c.operation,r.opfooter="";var u="_vti_bin/"+l[c.operation][0]+".asmx",p=void 0!==c.webURL?c.webURL:c.webUrl;if(p.charAt(p.length-1)===t.SLASH)u=p+u;else if(p.length>0)u=p+t.SLASH+u;else{var S=e().SPServices.SPGetCurrentSite();u=S+(S.charAt(S.length-1)===t.SLASH?u:t.SLASH+u)}switch(r.payload="",c.operation){case"GetAlerts":break;case"DeleteAlerts":for(r.payload+="",m=0;m";break;case"Mode":break;case"Login":a.addToPayload(c,r,["username","password"]);break;case"CopyIntoItems":for(a.addToPayload(c,r,["SourceUrl"]),r.payload+="",m=0;m",a.addToPayload(c,r,["Fields","Stream","Results"]);break;case"CopyIntoItemsLocal":for(a.addToPayload(c,r,["SourceUrl"]),r.payload+="",m=0;m";break;case"GetItem":a.addToPayload(c,r,["Url","Fields","Stream"]);break;case"GetForm":a.addToPayload(c,r,["listName","formUrl"]);break;case"GetFormCollection":a.addToPayload(c,r,["listName"]);break;case"AddAttachment":a.addToPayload(c,r,["listName","listItemID","fileName","attachment"]);break;case"AddDiscussionBoardItem":a.addToPayload(c,r,["listName","message"]);break;case"AddList":a.addToPayload(c,r,["listName","description","templateID"]);break;case"AddListFromFeature":a.addToPayload(c,r,["listName","description","featureID","templateID"]);break;case"ApplyContentTypeToList":a.addToPayload(c,r,["webUrl","contentTypeId","listName"]);break;case"CheckInFile":a.addToPayload(c,r,["pageUrl","comment","CheckinType"]);break;case"CheckOutFile":a.addToPayload(c,r,["pageUrl","checkoutToLocal","lastmodified"]);break;case"CreateContentType":a.addToPayload(c,r,["listName","displayName","parentType","fields","contentTypeProperties","addToView"]);break;case"DeleteAttachment":a.addToPayload(c,r,["listName","listItemID","url"]);break;case"DeleteContentType":a.addToPayload(c,r,["listName","contentTypeId"]);break;case"DeleteContentTypeXmlDocument":a.addToPayload(c,r,["listName","contentTypeId","documentUri"]);break;case"DeleteList":a.addToPayload(c,r,["listName"]);break;case"GetAttachmentCollection":a.addToPayload(c,r,["listName",["listItemID","ID"]]);break;case"GetList":a.addToPayload(c,r,["listName"]);break;case"GetListAndView":a.addToPayload(c,r,["listName","viewName"]);break;case"GetListCollection":break;case"GetListContentType":a.addToPayload(c,r,["listName","contentTypeId"]);break;case"GetListContentTypes":a.addToPayload(c,r,["listName"]);break;case"GetListItems":a.addToPayload(c,r,["listName","viewName",["query","CAMLQuery"],["viewFields","CAMLViewFields"],["rowLimit","CAMLRowLimit"],["queryOptions","CAMLQueryOptions"]]);break;case"GetListItemChanges":a.addToPayload(c,r,["listName","viewFields","since","contains"]);break;case"GetListItemChangesSinceToken":a.addToPayload(c,r,["listName","viewName",["query","CAMLQuery"],["viewFields","CAMLViewFields"],["rowLimit","CAMLRowLimit"],["queryOptions","CAMLQueryOptions"],{name:"changeToken",sendNull:!1},{name:"contains",sendNull:!1}]);break;case"GetVersionCollection":a.addToPayload(c,r,["strlistID","strlistItemID","strFieldName"]);break;case"UndoCheckOut":a.addToPayload(c,r,["pageUrl"]);break;case"UpdateContentType":a.addToPayload(c,r,["listName","contentTypeId","contentTypeProperties","newFields","updateFields","deleteFields","addToView"]);break;case"UpdateContentTypesXmlDocument":a.addToPayload(c,r,["listName","newDocument"]);break;case"UpdateContentTypeXmlDocument":a.addToPayload(c,r,["listName","contentTypeId","newDocument"]);break;case"UpdateList":a.addToPayload(c,r,["listName","listProperties","newFields","updateFields","deleteFields","listVersion"]);break;case"UpdateListItems":if(a.addToPayload(c,r,["listName"]),"undefined"!=typeof c.updates&&c.updates.length>0)a.addToPayload(c,r,["updates"]);else{for(r.payload+="",m=0;m"+a.escapeColumnValue(c.valuepairs[m][1])+"";"New"!==c.batchCmd&&(r.payload+=""+c.ID+""),r.payload+=""}break;case"AddMeeting":a.addToPayload(c,r,["organizerEmail","uid","sequence","utcDateStamp","title","location","utcDateStart","utcDateEnd","nonGregorian"]);break;case"CreateWorkspace":a.addToPayload(c,r,["title","templateName","lcid","timeZoneInformation"]);break;case"RemoveMeeting":a.addToPayload(c,r,["recurrenceId","uid","sequence","utcDateStamp","cancelMeeting"]);break;case"SetWorkspaceTitle":a.addToPayload(c,r,["title"]);break;case"GetRecordRouting":a.addToPayload(c,r,["recordRouting"]);break;case"GetRecordRoutingCollection":break;case"GetServerInfo":break;case"SubmitFile":a.addToPayload(c,r,["fileToSubmit"],["properties"],["recordRouting"],["sourceUrl"],["userName"]);break;case"ResolvePrincipals":a.addToPayload(c,r,["principalKeys","principalType","addToUserInfoList"]);break;case"SearchPrincipals":a.addToPayload(c,r,["searchText","maxResults","principalType"]);break;case"AddPermission":a.addToPayload(c,r,["objectName","objectType","permissionIdentifier","permissionType","permissionMask"]);break;case"AddPermissionCollection":a.addToPayload(c,r,["objectName","objectType","permissionsInfoXml"]);break;case"GetPermissionCollection":a.addToPayload(c,r,["objectName","objectType"]);break;case"RemovePermission":a.addToPayload(c,r,["objectName","objectType","permissionIdentifier","permissionType"]);break;case"RemovePermissionCollection":a.addToPayload(c,r,["objectName","objectType","memberIdsXml"]);break;case"UpdatePermission":a.addToPayload(c,r,["objectName","objectType","permissionIdentifier","permissionType","permissionMask"]);break;case"GetLinks":break;case"GetPortalSearchInfo":r.opheader="<"+c.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>",o="http://microsoft.com/webservices/OfficeServer/QueryService/"+c.operation;break;case"GetQuerySuggestions":r.opheader="<"+c.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>",o="http://microsoft.com/webservices/OfficeServer/QueryService/"+c.operation,r.payload+=a.wrapNode("queryXml",t.encodeXml(c.queryXml));break;case"GetSearchMetadata":r.opheader="<"+c.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>",o="http://microsoft.com/webservices/OfficeServer/QueryService/"+c.operation;break;case"Query":r.payload+=a.wrapNode("queryXml",t.encodeXml(c.queryXml));break;case"QueryEx":r.opheader="<"+c.operation+" xmlns='http://microsoft.com/webservices/OfficeServer/QueryService'>",o="http://microsoft.com/webservices/OfficeServer/QueryService/"+c.operation,r.payload+=a.wrapNode("queryXml",t.encodeXml(c.queryXml));break;case"Registration":r.payload+=a.wrapNode("registrationXml",t.encodeXml(c.registrationXml));break;case"Status":break;case"SendClientScriptErrorReport":a.addToPayload(c,r,["message","file","line","client","stack","team","originalFile"]);break;case"EnumerateFolder":a.addToPayload(c,r,["strFolderUrl"]);break;case"GetAttachments":a.addToPayload(c,r,["strListName","strItemId"]);break;case"SiteDataGetList":a.addToPayload(c,r,["strListName"]),r=t.siteDataFixSOAPEnvelope(r,c.operation);break;case"SiteDataGetListCollection":r=t.siteDataFixSOAPEnvelope(r,c.operation);break;case"SiteDataGetSite":r=t.siteDataFixSOAPEnvelope(r,c.operation);break;case"SiteDataGetSiteUrl":a.addToPayload(c,r,["Url"]),r=t.siteDataFixSOAPEnvelope(r,c.operation);break;case"SiteDataGetWeb":r=t.siteDataFixSOAPEnvelope(r,c.operation);break;case"CreateWeb":a.addToPayload(c,r,["url","title","description","templateName","language","languageSpecified","locale","localeSpecified","collationLocale","collationLocaleSpecified","uniquePermissions","uniquePermissionsSpecified","anonymous","anonymousSpecified","presence","presenceSpecified"]);break;case"DeleteWeb":a.addToPayload(c,r,["url"]);break;case"GetSite":a.addToPayload(c,r,["SiteUrl"]);break;case"GetSiteTemplates":a.addToPayload(c,r,["LCID","TemplateList"]);break;case"AddComment":a.addToPayload(c,r,["url","comment","isHighPriority","title"]);break;case"AddTag":a.addToPayload(c,r,["url","termID","title","isPrivate"]);break;case"AddTagByKeyword":a.addToPayload(c,r,["url","keyword","title","isPrivate"]);break;case"CountCommentsOfUser":a.addToPayload(c,r,["userAccountName"]);break;case"CountCommentsOfUserOnUrl":a.addToPayload(c,r,["userAccountName","url"]);break;case"CountCommentsOnUrl":a.addToPayload(c,r,["url"]);break;case"CountRatingsOnUrl":a.addToPayload(c,r,["url"]);break;case"CountTagsOfUser":a.addToPayload(c,r,["userAccountName"]);break;case"DeleteComment":a.addToPayload(c,r,["url","lastModifiedTime"]);break;case"DeleteRating":a.addToPayload(c,r,["url"]);break;case"DeleteTag":a.addToPayload(c,r,["url","termID"]);break;case"DeleteTagByKeyword":a.addToPayload(c,r,["url","keyword"]);break;case"DeleteTags":a.addToPayload(c,r,["url"]);break;case"GetAllTagTerms":a.addToPayload(c,r,["maximumItemsToReturn"]);break;case"GetAllTagTermsForUrlFolder":a.addToPayload(c,r,["urlFolder","maximumItemsToReturn"]);break;case"GetAllTagUrls":a.addToPayload(c,r,["termID"]);break;case"GetAllTagUrlsByKeyword":a.addToPayload(c,r,["keyword"]);break;case"GetCommentsOfUser":a.addToPayload(c,r,["userAccountName","maximumItemsToReturn","startIndex"]);break;case"GetCommentsOfUserOnUrl":a.addToPayload(c,r,["userAccountName","url"]);break;case"GetCommentsOnUrl":a.addToPayload(c,r,["url","maximumItemsToReturn","startIndex"]),"undefined"!=typeof c.excludeItemsTime&&c.excludeItemsTime.length>0&&(r.payload+=a.wrapNode("excludeItemsTime",c.excludeItemsTime));break;case"GetRatingAverageOnUrl":a.addToPayload(c,r,["url"]);break;case"GetRatingOfUserOnUrl":a.addToPayload(c,r,["userAccountName","url"]);break;case"GetRatingOnUrl":a.addToPayload(c,r,["url"]);break;case"GetRatingsOfUser":a.addToPayload(c,r,["userAccountName"]);break;case"GetRatingsOnUrl":a.addToPayload(c,r,["url"]);break;case"GetSocialDataForFullReplication":a.addToPayload(c,r,["userAccountName"]);break;case"GetTags":a.addToPayload(c,r,["url"]);break;case"GetTagsOfUser":a.addToPayload(c,r,["userAccountName","maximumItemsToReturn","startIndex"]);break;case"GetTagTerms":a.addToPayload(c,r,["maximumItemsToReturn"]);break;case"GetTagTermsOfUser":a.addToPayload(c,r,["userAccountName","maximumItemsToReturn"]);break;case"GetTagTermsOnUrl":a.addToPayload(c,r,["url","maximumItemsToReturn"]);break;case"GetTagUrls":a.addToPayload(c,r,["termID"]);break;case"GetTagUrlsByKeyword":a.addToPayload(c,r,["keyword"]);break;case"GetTagUrlsOfUser":a.addToPayload(c,r,["termID","userAccountName"]);break;case"GetTagUrlsOfUserByKeyword":a.addToPayload(c,r,["keyword","userAccountName"]);break;case"SetRating":a.addToPayload(c,r,["url","rating","title","analysisDataEntry"]);break;case"UpdateComment":a.addToPayload(c,r,["url","lastModifiedTime","comment","isHighPriority"]);break;case"SpellCheck":a.addToPayload(c,r,["chunksToSpell","declaredLanguage","useLad"]);break;case"AddTerms":a.addToPayload(c,r,["sharedServiceId","termSetId","lcid","newTerms"]);break;case"GetChildTermsInTerm":a.addToPayload(c,r,["sspId","lcid","termId","termSetId"]);break;case"GetChildTermsInTermSet":a.addToPayload(c,r,["sspId","lcid","termSetId"]);break;case"GetKeywordTermsByGuids":a.addToPayload(c,r,["termIds","lcid"]);break;case"GetTermsByLabel":a.addToPayload(c,r,["label","lcid","matchOption","resultCollectionSize","termIds","addIfNotFound"]);break;case"GetTermSets":a.addToPayload(c,r,["sharedServiceIds","termSetIds","lcid","clientTimeStamps","clientVersions"]);break;case"AddGroup":a.addToPayload(c,r,["groupName","ownerIdentifier","ownerType","defaultUserLoginName","description"]);break;case"AddGroupToRole":a.addToPayload(c,r,["groupName","roleName"]);break;case"AddRole":a.addToPayload(c,r,["roleName","description","permissionMask"]);break;case"AddRoleDef":a.addToPayload(c,r,["roleName","description","permissionMask"]);break;case"AddUserCollectionToGroup":a.addToPayload(c,r,["groupName","usersInfoXml"]);break;case"AddUserCollectionToRole":a.addToPayload(c,r,["roleName","usersInfoXml"]);break;case"AddUserToGroup":a.addToPayload(c,r,["groupName","userName","userLoginName","userEmail","userNotes"]);break;case"AddUserToRole":a.addToPayload(c,r,["roleName","userName","userLoginName","userEmail","userNotes"]);break;case"GetAllUserCollectionFromWeb":break;case"GetGroupCollection":a.addToPayload(c,r,["groupNamesXml"]);break;case"GetGroupCollectionFromRole":a.addToPayload(c,r,["roleName"]);break;case"GetGroupCollectionFromSite":break;case"GetGroupCollectionFromUser":a.addToPayload(c,r,["userLoginName"]);break;case"GetGroupCollectionFromWeb":break;case"GetGroupInfo":a.addToPayload(c,r,["groupName"]);break;case"GetRoleCollection":a.addToPayload(c,r,["roleNamesXml"]);break;case"GetRoleCollectionFromGroup":a.addToPayload(c,r,["groupName"]);break;case"GetRoleCollectionFromUser":a.addToPayload(c,r,["userLoginName"]);break;case"GetRoleCollectionFromWeb":break;case"GetRoleInfo":a.addToPayload(c,r,["roleName"]);break;case"GetRolesAndPermissionsForCurrentUser":break;case"GetRolesAndPermissionsForSite":break;case"GetUserCollection":a.addToPayload(c,r,["userLoginNamesXml"]);break;case"GetUserCollectionFromGroup":a.addToPayload(c,r,["groupName"]);break;case"GetUserCollectionFromRole":a.addToPayload(c,r,["roleName"]);break;case"GetUserCollectionFromSite":break;case"GetUserCollectionFromWeb":break;case"GetUserInfo":a.addToPayload(c,r,["userLoginName"]);break;case"GetUserLoginFromEmail":a.addToPayload(c,r,["emailXml"]);break;case"RemoveGroup":a.addToPayload(c,r,["groupName"]);break;case"RemoveGroupFromRole":a.addToPayload(c,r,["roleName","groupName"]);break;case"RemoveRole":a.addToPayload(c,r,["roleName"]);break;case"RemoveUserCollectionFromGroup":a.addToPayload(c,r,["groupName","userLoginNamesXml"]);break;case"RemoveUserCollectionFromRole":a.addToPayload(c,r,["roleName","userLoginNamesXml"]);break;case"RemoveUserCollectionFromSite":a.addToPayload(c,r,["userLoginNamesXml"]);break;case"RemoveUserFromGroup":a.addToPayload(c,r,["groupName","userLoginName"]);break;case"RemoveUserFromRole":a.addToPayload(c,r,["roleName","userLoginName"]);break;case"RemoveUserFromSite":a.addToPayload(c,r,["userLoginName"]);break;case"RemoveUserFromWeb":a.addToPayload(c,r,["userLoginName"]);break;case"UpdateGroupInfo":a.addToPayload(c,r,["oldGroupName","groupName","ownerIdentifier","ownerType","description"]);break;case"UpdateRoleDefInfo":a.addToPayload(c,r,["oldRoleName","roleName","description","permissionMask"]);break;case"UpdateRoleInfo":a.addToPayload(c,r,["oldRoleName","roleName","description","permissionMask"]);break;case"UpdateUserInfo":a.addToPayload(c,r,["userLoginName","userName","userEmail","userNotes"]);break;case"AddColleague":a.addToPayload(c,r,["accountName","colleagueAccountName","group","privacy","isInWorkGroup"]);break;case"AddLink":a.addToPayload(c,r,["accountName","name","url","group","privacy"]);break;case"AddMembership":a.addToPayload(c,r,["accountName","membershipInfo","group","privacy"]);break;case"AddPinnedLink":a.addToPayload(c,r,["accountName","name","url"]);break;case"CreateMemberGroup":a.addToPayload(c,r,["membershipInfo"]);break;case"CreateUserProfileByAccountName":a.addToPayload(c,r,["accountName"]);break;case"GetCommonColleagues":a.addToPayload(c,r,["accountName"]);break;case"GetCommonManager":a.addToPayload(c,r,["accountName"]);break;case"GetCommonMemberships":a.addToPayload(c,r,["accountName"]);break;case"GetInCommon":a.addToPayload(c,r,["accountName"]);break;case"GetPropertyChoiceList":a.addToPayload(c,r,["propertyName"]);break;case"GetUserColleagues":a.addToPayload(c,r,["accountName"]);break;case"GetUserLinks":a.addToPayload(c,r,["accountName"]);break;case"GetUserMemberships":a.addToPayload(c,r,["accountName"]);break;case"GetUserPinnedLinks":a.addToPayload(c,r,["accountName"]);break;case"GetUserProfileByGuid":a.addToPayload(c,r,["guid"]);break;case"GetUserProfileByIndex":a.addToPayload(c,r,["index"]);break;case"GetUserProfileByName":"undefined"!=typeof c.accountName&&c.accountName.length>0?a.addToPayload(c,r,[["AccountName","accountName"]]):a.addToPayload(c,r,["AccountName"]); +break;case"GetUserProfileCount":break;case"GetUserProfileSchema":break;case"GetUserPropertyByAccountName":a.addToPayload(c,r,["accountName","propertyName"]);break;case"ModifyUserPropertyByAccountName":a.addToPayload(c,r,["accountName","newData"]);break;case"RemoveAllColleagues":a.addToPayload(c,r,["accountName"]);break;case"RemoveAllLinks":a.addToPayload(c,r,["accountName"]);break;case"RemoveAllMemberships":a.addToPayload(c,r,["accountName"]);break;case"RemoveAllPinnedLinks":a.addToPayload(c,r,["accountName"]);break;case"RemoveColleague":a.addToPayload(c,r,["accountName","colleagueAccountName"]);break;case"RemoveLink":a.addToPayload(c,r,["accountName","id"]);break;case"RemoveMembership":a.addToPayload(c,r,["accountName","sourceInternal","sourceReference"]);break;case"RemovePinnedLink":a.addToPayload(c,r,["accountName","id"]);break;case"UpdateColleaguePrivacy":a.addToPayload(c,r,["accountName","colleagueAccountName","newPrivacy"]);break;case"UpdateLink":a.addToPayload(c,r,["accountName","data"]);break;case"UpdateMembershipPrivacy":a.addToPayload(c,r,["accountName","sourceInternal","sourceReference","newPrivacy"]);break;case"UpdatePinnedLink ":a.addToPayload(c,r,["accountName","data"]);break;case"DeleteAllVersions":a.addToPayload(c,r,["fileName"]);break;case"DeleteVersion":a.addToPayload(c,r,["fileName","fileVersion"]);break;case"GetVersions":a.addToPayload(c,r,["fileName"]);break;case"RestoreVersion":a.addToPayload(c,r,["fileName","fileVersion"]);break;case"AddView":a.addToPayload(c,r,["listName","viewName","viewFields","query","rowLimit","type","makeViewDefault"]);break;case"DeleteView":a.addToPayload(c,r,["listName","viewName"]);break;case"GetView":a.addToPayload(c,r,["listName","viewName"]);break;case"GetViewCollection":a.addToPayload(c,r,["listName"]);break;case"GetViewHtml":a.addToPayload(c,r,["listName","viewName"]);break;case"UpdateView":a.addToPayload(c,r,["listName","viewName","viewProperties","query","viewFields","aggregations","formats","rowLimit"]);break;case"UpdateViewHtml":a.addToPayload(c,r,["listName","viewName","viewProperties","toolbar","viewHeader","viewBody","viewFooter","viewEmpty","rowLimitExceeded","query","viewFields","aggregations","formats","rowLimit"]);break;case"AddWebPart":a.addToPayload(c,r,["pageUrl","webPartXml","storage"]);break;case"AddWebPartToZone":a.addToPayload(c,r,["pageUrl","webPartXml","storage","zoneId","zoneIndex"]);break;case"DeleteWebPart":a.addToPayload(c,r,["pageUrl","storageKey","storage"]);break;case"GetWebPart2":a.addToPayload(c,r,["pageUrl","storageKey","storage","behavior"]);break;case"GetWebPartPage":a.addToPayload(c,r,["documentName","behavior"]);break;case"GetWebPartProperties":a.addToPayload(c,r,["pageUrl","storage"]);break;case"GetWebPartProperties2":a.addToPayload(c,r,["pageUrl","storage","behavior"]);break;case"SaveWebPart2":a.addToPayload(c,r,["pageUrl","storageKey","webPartXml","storage","allowTypeChange"]);break;case"WebsCreateContentType":a.addToPayload(c,r,["displayName","parentType","newFields","contentTypeProperties"]);break;case"GetColumns":a.addToPayload(c,r,["webUrl"]);break;case"GetContentType":a.addToPayload(c,r,["contentTypeId"]);break;case"GetContentTypes":break;case"GetCustomizedPageStatus":a.addToPayload(c,r,["fileUrl"]);break;case"GetListTemplates":break;case"GetObjectIdFromUrl":a.addToPayload(c,r,["objectUrl"]);break;case"GetWeb":a.addToPayload(c,r,[["webUrl","webURL"]]);break;case"GetWebCollection":break;case"GetAllSubWebCollection":break;case"UpdateColumns":a.addToPayload(c,r,["newFields","updateFields","deleteFields"]);break;case"WebsUpdateContentType":a.addToPayload(c,r,["contentTypeId","contentTypeProperties","newFields","updateFields","deleteFields"]);break;case"WebUrlFromPageUrl":a.addToPayload(c,r,[["pageUrl","pageURL"]]);break;case"AlterToDo":a.addToPayload(c,r,["item","todoId","todoListId","taskData"]);break;case"ClaimReleaseTask":a.addToPayload(c,r,["item","taskId","listId","fClaim"]);break;case"GetTemplatesForItem":a.addToPayload(c,r,["item"]);break;case"GetToDosForItem":a.addToPayload(c,r,["item"]);break;case"GetWorkflowDataForItem":a.addToPayload(c,r,["item"]);break;case"GetWorkflowTaskData":a.addToPayload(c,r,["item","listId","taskId"]);break;case"StartWorkflow":a.addToPayload(c,r,["item","templateId","workflowParameters"])}var f,y=r.header+r.opheader+r.payload+r.opfooter+r.footer;c.cacheXML&&(f=i[y]);var h=c.customHeaders?c.customHeaders:{};if("undefined"==typeof f){var T=e.ajax({url:u,async:c.async,headers:h,beforeSend:function(e){l[c.operation][1]&&e.setRequestHeader("SOAPAction",o)},type:"POST",data:y,dataType:"xml",contentType:"text/xml;charset='utf-8'",complete:function(t,a){e.isFunction(c.completefunc)&&c.completefunc(t,a)}});return c.cacheXML&&(i[y]=T),T}return e.isFunction(c.completefunc)&&f.done(function(e,t,a){c.completefunc(a,t)}),f},e.fn.NintexServices=function(d){for(var c=e.extend({},e.fn.SPServices.defaults,d),m=0;m",o=t.SCHEMANintex+"/";break;default:r.opheader+="xmlns='"+t.SCHEMANintex+"/soap/'>",o=t.SCHEMANintex+"/soap/"}o+=c.operation,r.opfooter="";var u="_vti_bin/"+l[c.operation][0]+".asmx",p=e().SPServices.SPGetCurrentSite(),S=void 0!==c.webURL?c.webURL:c.webUrl;switch(u=S.charAt(S.length-1)===t.SLASH?S+u:S.length>0?S+t.SLASH+u:p+(p.charAt(p.length-1)===t.SLASH?u:t.SLASH+u),r.payload="",c.operation){case"AddLongTermDelegationRule":a.addToPayload(c,["fromTheBeginningOf","untilTheEndOf","delegateFrom","delegateTo","currentSiteOnly"]);break;case"AddWorkflowSchedule":a.addToPayload(c,["fileUrl","workflowName","startDataXml"]),r.payload+="",a.addToPayload(c,["MaximumRepeats","WorkdaysOnly"]),r.payload+="",a.addToPayload(c,["Type","CountBetweenIntervals"]),r.payload+="",a.addToPayload(c,["EndOn","StartTime","EndTime"]),r.payload+="",a.addToPayload(c,["updateIfExists"]);break;case"AddWorkflowScheduleOnListItem":a.addToPayload(c,["itemId","listName","workflowName","startDataXML"]),r.payload+="",a.addToPayload(c,["MaximumRepeats","WorkdaysOnly"]),r.payload+="",a.addToPayload(c,["Type","CountBetweenIntervals"]),r.payload+="",a.addToPayload(c,["EndOn","StartTime","EndTime"]),r.payload+="",a.addToPayload(c,["updateIfExists"]);break;case"CheckGlobalReuseStatus":a.addToPayload(c,["workflowName"]);break;case"CheckInForms":a.addToPayload(c,["workflowConfiguration","activityConfiguration","formType"]);break;case"DelegateAllTasks":a.addToPayload(c,["currentUser","newUser","sendNotification","comments","global"]);break;case"DelegateTask":a.addToPayload(c,["spTaskId","taskListName","targetUserName","comments","sendNotification"]);break;case"DeleteLongTermDelegationRule":a.addToPayload(c,["id"]);break;case"DeleteSnippet":a.addToPayload(c,["snippetId"]);break;case"DeleteWorkflow":a.addToPayload(c,["listId","workflowId","workflowType"]);break;case"ExportWorkflow":a.addToPayload(c,["listName","workflowType","workflowName"]);break;case"FixWorkflowsInSiteFromTemplate":a.addToPayload(c,["FixWorkflowsInSiteFromTemplate"]);break;case"GetFolders":a.addToPayload(c,["listGuid"]);break;case"GetItemsPendingMyApproval":a.addToPayload(c,["uniquenessInfo"]);break;case"GetListContentTypes":a.addToPayload(c,["listGuid"]);break;case"GetOutcomesForFlexiTask":a.addToPayload(c,["spTaskId","taskListName"]);break;case"GetRunningWorkflowTasks":a.addToPayload(c,["fileUrl"]);break;case"GetRunningWorkflowTasksCollection":a.addToPayload(c,["userlogin","teamsiteUrl","listName"]);break;case"GetRunningWorkflowTasksForCurrentUser":a.addToPayload(c,["fileUrl"]);break;case"GetRunningWorkflowTasksForCurrentUserForListItem":a.addToPayload(c,["itemId","listName"]);break;case"GetRunningWorkflowTasksForListItem":a.addToPayload(c,["itemId","listName"]);break;case"GetTaskDetailsUsingStub":a.addToPayload(c,["taskToken"]);break;case"GetTaskStubsForCurrentUser":break;case"GetWorkflowHistory":a.addToPayload(c,["fileUrl","stateFilter","workflowNameFilter"]);break;case"GetWorkflowHistoryForListItem":a.addToPayload(c,["itemId","listName","stateFilter","workflowNameFilter"]);break;case"HideTaskForApprover":a.addToPayload(c,["approverId","contentDbId"]);break;case"HideWorkflow":a.addToPayload(c,["siteId","instanceId"]);break;case"ProcessFlexiTaskResponse":a.addToPayload(c,["comments","outcome","spTaskId","taskListName"]);break;case"ProcessFlexiTaskResponse2":a.addToPayload(c,["comments","outcome","spTaskId","taskListName"]);break;case"ProcessTaskResponse":a.addToPayload(c,["comments","outcome","spTaskId"]);break;case"ProcessTaskResponse2":a.addToPayload(c,["comments","outcome","spTaskId","taskListName"]);break;case"ProcessTaskResponse3":a.addToPayload(c,["comments","outcome","spTaskId","taskListName"]);break;case"ProcessTaskResponseUsingToken":a.addToPayload(c,["comments","outcome","taskToken","customOutcome"]);break;case"PublishFromNWF":a.addToPayload(c,["workflowFile","listName","workflowName","saveIfCannotPublish"]);break;case"PublishFromNWFNoOverwrite":a.addToPayload(c,["workflowFile","listName","workflowName","saveIfCannotPublish"]);break;case"PublishFromNWFSkipValidation":a.addToPayload(c,["workflowFile","listName","workflowName","saveIfCannotPublish"]);break;case"PublishFromNWFSkipValidationNoOverwrite":a.addToPayload(c,["workflowFile","listName","workflowName","saveIfCannotPublish"]);break;case"PublishFromNWFXml":a.addToPayload(c,["workflowFile","listName","workflowName","saveIfCannotPublish"]);break;case"PublishFromNWFXmlNoOverwrite":a.addToPayload(c,["workflowFile","listName","workflowName","saveIfCannotPublish"]);break;case"PublishFromNWFXmlSkipValidation":a.addToPayload(c,["workflowFile","listName","workflowName","saveIfCannotPublish"]);break;case"PublishFromNWFXmlSkipValidationNoOverwrite":a.addToPayload(c,["workflowFile","listName","workflowName","saveIfCannotPublish"]);break;case"PublishWorkflow":a.addToPayload(c,["wfName","activityConfigs","listId","contentTypeId","changeNotes"]);break;case"QueryForMessages":a.addToPayload(c,["workflowInstanceId","messageId"]);break;case"RemoveWorkflowSchedule":a.addToPayload(c,["fileUrl","workflowName"]);break;case"RemoveWorkflowScheduleOnListItem":a.addToPayload(c,["itemId","listName","workflowName"]);break;case"SaveFromNWF":a.addToPayload(c,["workflowFile","listName","workflowName"]);break;case"SaveFromNWFNoOverwrite":a.addToPayload(c,["workflowFile","listName","workflowName"]);break;case"SaveFromNWFXml":a.addToPayload(c,["workflowFile","listName","workflowName"]);break;case"SaveFromNWFXmlNoOverwrite":a.addToPayload(c,["workflowFile","listName","workflowName"]);break;case"SaveSnippet":a.addToPayload(c,["snippetName","activityConfigs"]);break;case"SaveTemplate":a.addToPayload(c,["templateName","templateDescription","category","activityConfigs"]);break;case"SaveTemplate2":a.addToPayload(c,["templateName","templateDescription","category","activityConfigs","lcid"]);break;case"SaveWorkflow":a.addToPayload(c,["wfName","activityConfigs","listId","contentTypeId","changeNotes"]);break;case"SnippetExists":a.addToPayload(c,["snippetName"]);break;case"StartSiteWorkflow":a.addToPayload(c,["workflowName","associationData"]);break;case"StartWorkflow":a.addToPayload(c,["fileUrl","workflowName","associationData"]);break;case"StartWorkflowOnListItem":a.addToPayload(c,["itemId","listName","workflowName","associationData"]);break;case"TemplateExists":a.addToPayload(c,["templateName"]);break;case"TerminateWorkflow":a.addToPayload(c,["listId","itemId","instanceId"]);break;case"TerminateWorkflowByName":a.addToPayload(c,["fileUrl","workflowName","terminatePreviousInstances"]);break;case"TerminateWorkflowByNameForListItem":a.addToPayload(c,["listName","itemId","workflowName","terminatePreviousInstances"]);break;case"WorkflowExists":a.addToPayload(c,["workflowName","listId","workflowType"]);break;case"WorkflowFormProductSelected":a.addToPayload(c,["workflowConfiguration","activityConfiguration","product","formType"])}var f,y=r.header+r.opheader+r.payload+r.opfooter+r.footer;if(c.cacheXML&&(f=i[y]),"undefined"==typeof f){var h=e.ajax({url:u,async:c.async,beforeSend:function(e){l[c.operation][1]&&e.setRequestHeader("SOAPAction",o)},type:"POST",data:y,dataType:"xml",contentType:"text/xml;charset='utf-8'",complete:function(t,a){e.isFunction(c.completefunc)&&c.completefunc(t,a)}});return c.cacheXML&&(i[y]=h),h}return e.isFunction(c.completefunc)&&f.done(function(e,t,a){c.completefunc(a,t)}),f},e.fn.SPServices.defaults={cacheXML:!1,operation:"",webURL:"",customHeaders:{},makeViewDefault:!1,viewName:"",CAMLQuery:"",CAMLViewFields:"",CAMLRowLimit:0,CAMLQueryOptions:"",batchCmd:"Update",valuepairs:[],DestinationUrls:[],behavior:"Version3",storage:"Shared",objectType:"List",cancelMeeting:!0,nonGregorian:!1,fClaim:!1,recurrenceId:0,sequence:0,maximumItemsToReturn:0,startIndex:0,isHighPriority:!1,isPrivate:!1,rating:1,maxResults:10,principalType:"User",async:!0,completefunc:null}}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t){e.exports=jQuery},function(e,t,a){var o,r;o=[],r=function(){"use strict";var e={VERSION:"@VERSION",spDelim:";#",SLASH:"/",TXTColumnNotFound:"Column not found on page",SCHEMASharePoint:"http://schemas.microsoft.com/sharepoint",SCHEMANintex:"http://nintex.com",multiLookupPrefix:"MultiLookupPicker",multiLookupPrefix2013:"MultiLookup",dropdownType:{simple:"S",complex:"C",multiSelect:"M"},spListFieldTypes:["Integer","Text","Note","DateTime","Counter","Choice","Lookup","Boolean","Number","Currency","URL","MultiChoice","Calculated","File","Attachments","User","Recurrence","ModStat","ContentTypeId","WorkflowStatus","AllDayEvent","RelatedItems","UserMulti","LookupMulti","datetime","float","Calc"]};return e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3)],r=function(e,t){"use strict";var a={SPServicesContext:function(t){var a=e.extend({},{listName:"",thisUserId:""},t),o=location.protocol+"//"+location.host,r={};return"undefined"!=typeof _spPageContextInfo?(r.thisSite=o+_spPageContextInfo.webServerRelativeUrl,r.thisList=a.listName?a.listName:_spPageContextInfo.pageListId,r.thisUserId=a.thisUserId?a.thisUserId:_spPageContextInfo.userId):(r.thisSite="undefined"!=typeof L_Menu_BaseUrl?o+L_Menu_BaseUrl:"",r.thisList=a.listName?a.listName:"",r.thisUserId=a.thisUserId?a.thisUserId:"undefined"!=typeof _spUserId?_spUserId:void 0),r},wrapNode:function(e,t){var a="undefined"!=typeof t?t:"";return"<"+e+">"+a+""},randOrd:function(){return Math.round(Math.random())-.5},checkLink:function(e){return 0===e.indexOf("http")||0===e.indexOf("/")?"
    "+e+"":e},fileName:function(e){return e.substring(e.lastIndexOf("/")+1,e.length)},xml_special_to_escaped_one_map:{"&":"&",'"':""","<":"<",">":">"},encodeXml:function(e){return e.replace(/([\&"<>])/g,function(e,t){return this.xml_special_to_escaped_one_map[t]})},escapeColumnValue:function(e){return"string"==typeof e?e.replace(/&(?![a-zA-Z]{1,8};)/g,"&"):e},escapeUrl:function(e){return e.replace(/&/g,"%26")},SplitIndex:function(e){var a=e.split(t.spDelim);this.id=a[0],this.value=a[1]},pad:function(e){return 10>e?"0"+e:e},errBox:function(e,t,a){var r="Error in function
    "+e+"
    Parameter
    "+t+"
    Message
    "+a+"

    Click to continue
    ";o(r)},findFormField:function(t){var a=e("td.ms-formbody, td.ms-formbodysurvey"),o=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")},r=o(t),i=new RegExp('(?:Field|FieldInternal)Name="'+r+'"',"i"),s=a.contents().filter(function(){return 8===this.nodeType&&i.test(this.nodeValue)});return s.parent("td")},showAttrs:function(e){var t,o="";for(t=0;t";return o+="
    "+t+""+e.attributes.item(t).nodeName+""+a.checkLink(e.attributes.item(t).nodeValue)+"
    "},addToPayload:function(t,o,r){var i;for(i=0;i"+t);var o=e("#SPServices_msgBox"),r=o.height(),i=o.width(),s=e(window).width()/2-i/2+"px",n=e(window).height()/2-r/2-100+"px";o.css({border:"5px #C02000 solid",left:s,top:n}).show().fadeTo("slow",.75).click(function(){e(this).fadeOut("3000",function(){e(this).remove()})})};return a}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(1)],r=function(e,t){"use strict";return e.fn.SPServices.Version=function(){return t.VERSION},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";return e.fn.SPServices.SPConvertDateToISO=function(t){var o=e.extend({},{dateToConvert:new Date,dateOffset:"-05:00"},t),r="",i=o.dateToConvert;return r+=i.getFullYear()+"-",r+=a.pad(i.getMonth()+1)+"-",r+=a.pad(i.getDate()),r+="T"+a.pad(i.getHours())+":",r+=a.pad(i.getMinutes())+":",r+=a.pad(i.getSeconds())+"Z"+o.dateOffset},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(4),a(1)],r=function(e,t){"use strict";return e.fn.SPServices.SPDebugXMLHttpResult=function(a){var o,r=e.extend({},{node:null,indent:0},a),i=3,s=4,n="";if(n+="","DisplayPattern"===r.node.nodeName)n+="";else if(r.node.hasChildNodes())if(r.node.hasChildNodes()&&r.node.firstChild.nodeType===s)n+="";else if(r.node.hasChildNodes()&&r.node.firstChild.nodeType===i)n+="";else{for(n+="",r.node.attributes&&(n+=""),n+=""}else n+="",r.node.attributes&&(n+="");return n+="
    "+r.node.nodeName+"
    "+r.node.nodeName+"
    "+r.node.nodeName+""+t.checkLink(r.node.firstChild.nodeValue)+"
    "+r.node.nodeName+"
    "+t.showAttrs(r.node)+"
    ",o=0;o
    "+r.node.nodeName+""+(null!==r.node.nodeValue?t.checkLink(r.node.nodeValue):" ")+"
    "+t.showAttrs(r.node)+"
    "},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(4),a(3),a(1)],r=function(e,t,a){"use strict";return e.fn.SPServices.SPDropdownCtl=function(o){var r=e.extend({},{displayName:""},o),i={};if(1===(i.Obj=e("select[Title='"+r.displayName+"']")).length?i.Type=a.dropdownType.simple:1===(i.Obj=e("input[Title='"+r.displayName+"']")).length?i.Type=a.dropdownType.complex:1===(i.Obj=e("select[ID$='SelectCandidate'][Title^='"+r.displayName+" ']")).length?i.Type=a.dropdownType.multiSelect:1===(i.Obj=e("select[ID$='SelectCandidate'][Title$=': "+r.displayName+"']")).length?i.Type=a.dropdownType.multiSelect:1===(i.Obj=e("select[ID$='SelectCandidate'][Title$='\""+r.displayName+"\".']")).length?i.Type=a.dropdownType.multiSelect:1===(i.Obj=e("select[ID$='SelectCandidate'][Title$=' "+r.displayName+"']")).length?i.Type=a.dropdownType.multiSelect:i.Type=null,null===i.Type){var s=t.findFormField(r.displayName);if(void 0!==s){var n=s.find("select[title^='"+r.displayName+" '][id$='_Lookup']"),l=s.find("select[title^='"+r.displayName+" '][id$='LookupField']"),d=n.length>0?n:l;d&&1===d.length&&(i.Type=a.dropdownType.simple,i.Obj=d)}}if(i.Type===a.dropdownType.complex)i.optHid=e("input[id='"+i.Obj.attr("optHid")+"']");else if(i.Type===a.dropdownType.multiSelect){i.container=i.Obj.closest("span"),i.MultiLookupPickerdata=i.container.find("input[id$='"+t.multiLookupPrefix+"_data'], input[id$='"+t.multiLookupPrefix2013+"_data']");var c=i.container.find("[id$='AddButton']").attr("id");i.master=window[c.replace(/AddButton/,a.multiLookupPrefix+"_m")]||window[c.replace(/AddButton/,a.multiLookupPrefix2013+"_m")]}return i},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2)],r=function(e){"use strict";return e.fn.SPFilterNode=function(e){return this.find("*").filter(function(){return this.nodeName===e})},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";var o=window.SPServices||{};return e.fn.SPServices.SPGetCurrentSite=function(){var r=a.SPServicesContext();if(r.thisSite.length>0)return r.thisSite;var i=o.SOAPEnvelope.header+""+(location.href.indexOf("?")>0?location.href.substr(0,location.href.indexOf("?")):location.href)+""+o.SOAPEnvelope.footer;return e.ajax({async:!1,url:"/_vti_bin/Webs.asmx",type:"POST",data:i,dataType:"xml",contentType:'text/xml;charset="utf-8"',complete:function(t){r.thisSite=e(t.responseXML).find("WebUrlFromPageUrlResult").text()}}),r.thisSite},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(4),a(1)],r=function(e,t){"use strict";return e.fn.SPServices.SPGetCurrentUser=function(a){var o=e.extend({},{webURL:"",fieldName:"Name",fieldNames:{},debug:!1},a),r=t.SPServicesContext();if("ID"===o.fieldName&&"undefined"!=typeof r.thisUserId)return r.thisUserId;var i,s="",n={},l=o.fieldNames.length>0?o.fieldNames.length:1,d=o.webURL.length>0?o.webURL:e().SPServices.SPGetCurrentSite();e.ajax({async:!1,url:("/"===d?"":d)+"/_layouts/userdisp.aspx?Force=True&"+(new Date).getTime(),complete:function(e){i=e}});for(var c=0;l>c;c++){if("ID"===o.fieldNames[c])s=r.thisUserId;else{var m;m=l>1?RegExp('FieldInternalName="'+o.fieldNames[c]+'"',"gi"):RegExp('FieldInternalName="'+o.fieldName+'"',"gi"),e(i.responseText).find("table.ms-formtable td[id^='SPField']").each(function(){if(m.test(e(this).html())){switch(e(this).attr("id")){case"SPFieldText":s=e(this).text();break;case"SPFieldNote":s=e(this).find("div").html();break;case"SPFieldURL":s=e(this).find("img").attr("src");break;default:s=e(this).text()}return!1}})}"ID"!==o.fieldNames[c]&&(s="undefined"!=typeof s?s.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g,""):null),l>1&&(n[o.fieldNames[c]]=s)}return l>1?n:s},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(1)],r=function(e){"use strict";return e.fn.SPServices.SPGetDisplayFromStatic=function(t){var a=e.extend({},{webURL:"",listName:"",columnStaticName:"",columnStaticNames:{}},t),o="",r={},i=a.columnStaticNames.length>0?a.columnStaticNames.length:1;return e().SPServices({operation:"GetList",async:!1,cacheXML:!0,webURL:a.webURL,listName:a.listName,completefunc:function(t){if(i>1)for(var s=0;i>s;s++)r[a.columnStaticNames[s]]=e(t.responseXML).find("Field[StaticName='"+a.columnStaticNames[s]+"']").attr("DisplayName");else o=e(t.responseXML).find("Field[StaticName='"+a.columnStaticName+"']").attr("DisplayName")}}),i>1?r:o},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(1)],r=function(e){"use strict";return e.fn.SPServices.SPGetLastItemId=function(t){var a,o=e.extend({},{webURL:"",listName:"",userAccount:"",CAMLQuery:""},t),r=0;e().SPServices({operation:"GetUserInfo",webURL:o.webURL,async:!1,userLoginName:""!==o.userAccount?o.userAccount:e().SPServices.SPGetCurrentUser(),completefunc:function(t){e(t.responseXML).find("User").each(function(){a=e(this).attr("ID")})}});var i="";return o.CAMLQuery.length>0&&(i+=""),i+=""+a+"",o.CAMLQuery.length>0&&(i+=o.CAMLQuery+""),i+="",e().SPServices({operation:"GetListItems",async:!1,webURL:o.webURL,listName:o.listName,CAMLQuery:i,CAMLViewFields:"",CAMLRowLimit:1,CAMLQueryOptions:"",completefunc:function(t){e(t.responseXML).SPFilterNode("z:row").each(function(){r=e(this).attr("ows_ID")})}}),r},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(1)],r=function(e,t){"use strict";return e.fn.SPServices.SPGetListItemsJson=function(a){var o,r=e.extend({},{webURL:"",listName:"",viewName:"",CAMLQuery:"",CAMLViewFields:"",CAMLRowLimit:"",CAMLQueryOptions:"",changeToken:"",contains:"",mapping:null,mappingOverrides:null,debug:!1},e().SPServices.defaults,a),i={},s=[],n=e.Deferred(),l=e().SPServices({operation:"GetListItemChangesSinceToken",webURL:r.webURL,listName:r.listName,viewName:r.viewName,CAMLQuery:r.CAMLQuery,CAMLViewFields:r.CAMLViewFields,CAMLRowLimit:r.CAMLRowLimit,CAMLQueryOptions:r.CAMLQueryOptions,changeToken:r.changeToken,contains:r.contains});return l.then(function(){var a="SPGetListItemsJson"+r.webURL+r.listName,d=e(l.responseXML);if(o=d.find("Changes").attr("LastChangeToken"),d.find("listitems Changes Id[ChangeType='Delete']").each(function(){s.push(e(this).text())}),null===r.mapping?d.find("List > Fields > Field").each(function(){var a=e(this),o=a.attr("Type");e.inArray(o,t.spListFieldTypes)>=0&&(i["ows_"+a.attr("Name")]={mappedName:a.attr("Name"),objectType:a.attr("Type")})}):i=r.mapping,null!==r.mappingOverrides)for(var c in r.mappingOverrides)i[c]=r.mappingOverrides[c];e.isEmptyObject(i)?i=e(document).data(a):e(document).data(a,i);var m=d.SPFilterNode("z:row").SPXmlToJson({mapping:i,sparse:!0}),u={changeToken:o,mapping:i,data:m,deletedIds:s};n.resolveWith(u)},function(e){n.rejectWith(e)}),n.promise()},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2)],r=function(e){"use strict";return e.fn.SPServices.SPGetQueryString=function(t){for(var a=e.extend({},{lowercase:!1},t),o={},r=location.search.slice(1).split("&"),i=0;i0?a.columnDisplayNames.length:1;return e().SPServices({operation:"GetList",async:!1,cacheXML:!0,webURL:a.webURL,listName:a.listName,completefunc:function(t){if(i>1)for(var s=0;i>s;s++)r[a.columnDisplayNames[s]]=e(t.responseXML).find("Field[DisplayName='"+a.columnDisplayNames[s]+"']").attr("StaticName");else o=e(t.responseXML).find("Field[DisplayName='"+a.columnDisplayName+"']").attr("StaticName")}}),i>1?r:o},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";return e.fn.SPServices.SPListNameFromUrl=function(o){var r=e.extend({},{listName:""},o),i=a.SPServicesContext();if(r.listName.length>0)return r.listName;if(void 0!==i.thisList&&i.thisList.length>0)return i.thisList;var s=location.href,n=s.substring(0,s.indexOf(".aspx")),l=decodeURIComponent(n.substring(0,n.lastIndexOf(t.SLASH)+1)).toUpperCase();return e().SPServices({operation:"GetListCollection",async:!1,completefunc:function(a){e(a.responseXML).find("List").each(function(){var a=e(this).attr("DefaultViewUrl"),o=a.substring(0,a.lastIndexOf(t.SLASH)+1).toUpperCase();return l.indexOf(o)>0?(i.thisList=e(this).attr("ID"),!1):void 0})}}),i.thisList},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4)],r=function(e,t,a){"use strict";function o(e,t){function a(e){return e}var o={Integer:r,Number:i,Boolean:s,DateTime:n,User:l,UserMulti:d,Lookup:c,lookupMulti:m,MultiChoice:u,Calculated:f,Attachments:p,URL:S,JSON:y,Text:o.Default,Counter:o.Integer,datetime:o.DateTime,AllDayEvent:o.Boolean,Recurrence:o.Boolean,Currency:o.Number,"float":o.Number,RelatedItems:o.JSON,Default:a};return(o[t]||a)(e)}function r(e){return parseInt(e,10)}function i(e){return parseFloat(e)}function s(e){return"0"!==e}function n(e){var t=e.split("T")[0]!==e?e.split("T"):e.split(" "),a=t[0].split("-"),o=t[1].split(":"),r=o[2].split("Z");return new Date(a[0],a[1]-1,a[2],o[0],o[1],r[0])}function l(e){if(0===e.length)return null;var t=new a.SplitIndex(e),o=t.value.split(",#");return 1===o.length?{userId:t.id,userName:t.value}:{userId:t.id,userName:o[0].replace(/(,,)/g,","),loginName:o[1].replace(/(,,)/g,","),email:o[2].replace(/(,,)/g,","),sipAddress:o[3].replace(/(,,)/g,","),title:o[4].replace(/(,,)/g,",")}}function d(e){if(0===e.length)return null;for(var a=[],o=e.split(t.spDelim),r=0;r"),m=0;m"),c.append(i[m]);if(r){var u=e("
    ");u.find("tr").append(a),u.find("tr").append(n),c.append(u)}var p=e(l).find("table:first");p.before(c),p.hide()})},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(4),a(1)],r=function(e,t){"use strict";return e.fn.SPServices.SPAutocomplete=function(a){var o,r=e.extend({},{webURL:"",sourceList:"",sourceColumn:"",columnName:"",listName:e().SPServices.SPListNameFromUrl(),CAMLQuery:"",CAMLQueryOptions:"",CAMLRowLimit:0,filterType:"BeginsWith",numChars:0,ignoreCase:!1,highlightClass:"",uniqueVals:!1,maxHeight:99999,slideDownSpeed:"fast",processingIndicator:"_layouts/images/REFRESH.GIF",debug:!1},a),i=t.findFormField(r.columnName).find("input[Title^='"+r.columnName+"']");i.css("position","");var s=i.css("color"),n=i.css("width");if(null===i.html()&&r.debug)return void t.errBox("SPServices.SPAutocomplete","columnName: "+r.columnName,"Column is not an input control or is not found on page");i.closest("span").find("br").remove(),i.wrap("
    ");var l=t.genContainerId("SPAutocomplete",r.columnName,r.listName);i.after("
    ");var d=e("#"+l);d.css("width",n),e(i).keyup(function(){var t=e(this).val();if(d.hide(),t.length";r.CAMLQuery.length>0&&(n+=""),n+="<"+r.filterType+">"+t+"",r.CAMLQuery.length>0&&(n+=r.CAMLQuery+""),n+="",e().SPServices({operation:"GetListItems",async:!1,webURL:r.WebURL,listName:r.sourceList,CAMLQuery:n,CAMLQueryOptions:r.CAMLQueryOptions,CAMLViewFields:"",CAMLRowLimit:r.CAMLRowLimit,completefunc:function(o){var i=r.ignoreCase?t.toUpperCase():t;e(o.responseXML).SPFilterNode("z:row").each(function(){var t=e(this).attr("ows_"+r.sourceColumn),o=r.ignoreCase?e(this).attr("ows_"+r.sourceColumn).toUpperCase():e(this).attr("ows_"+r.sourceColumn);if("Contains"===r.filterType){var s=o.indexOf(i);s>=0&&(!r.uniqueVals||-1===e.inArray(t,a))&&a.push(e(this).attr("ows_"+r.sourceColumn))}else i!==o.substr(0,i.length)||r.uniqueVals&&-1!==e.inArray(t,a)||a.push(e(this).attr("ows_"+r.sourceColumn))})}});for(var c="",m=0;m0){var u=new RegExp(t,r.ignoreCase?"gi":"g"),p=a[m].match(u),S=0;for(o=0;o"+p[o]+"";a[m]=a[m].substr(0,f)+h+a[m].substr(y),S=f+h.length}}c+="
  • "+a[m]+"
  • "}d.html(c),e("#"+l+" li").click(function(){e("#"+l).fadeOut(r.slideUpSpeed),i.val(e(this).text())}).mouseover(function(){var t={cursor:"hand",color:"#ffffff",background:"#3399ff"};e(this).css(t)}).mouseout(function(){var t={cursor:"inherit",color:s,background:"transparent"};e(this).css(t)}),a.length>0&&e("#"+l).slideDown(r.slideDownSpeed),i.css("background-image","")})},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";function o(o){var r,i,s,n,l,d="",c=null,m=o.Obj.data("SPCascadeDropdownsChildColumns");e(m).each(function(){var m,u=this.opt,p=this.childSelect,S=this.childColumnStatic,f=this.childColumnRequired;r=a.getDropdownSelected(o,u.matchOnId);var y=r.join(t.spDelim);if(o.Obj.data("SPCascadeDropdown_Selected_"+S)!==y){o.Obj.data("SPCascadeDropdown_Selected_"+S,y),c=a.getDropdownSelected(p,!0);var h=u.relationshipListSortColumn.length>0?u.relationshipListSortColumn:u.relationshipListChildColumn,T="";if(u.CAMLQuery.length>0&&(T+=""),0===r.length)T+="";else if(1===r.length)T+="":"'/>")+a.escapeColumnValue(r[0])+"";else{var P=r.length>2;for(m=0;m";for(m=0;m":"'/>")+a.escapeColumnValue(r[m])+"",m>0&&m");T+=""}u.CAMLQuery.length>0&&(T+=u.CAMLQuery+""),T+="",T+="",e().SPServices({operation:"GetListItems",async:!1,webURL:u.relationshipWebURL,listName:u.relationshipList,CAMLQuery:T,CAMLViewFields:"",CAMLRowLimit:0,CAMLQueryOptions:u.CAMLQueryOptions,completefunc:function(o){switch(e(o.responseXML).find("errorstring").each(function(){var t="SPServices.SPCascadeDropdowns",o=e(this).text();u.debug&&"One or more field types are not installed properly. Go to the list settings page to delete these fields."===o?a.errBox(t,"relationshipListParentColumn: "+u.relationshipListParentColumn+" or relationshipListChildColumn: "+u.relationshipListChildColumn,"Not found in relationshipList "+u.relationshipList):u.debug&&"Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."===o&&a.errBox(t,"relationshipList: "+u.relationshipList,"List not found")}),p.Type){case t.dropdownType.simple:p.Obj[0].innerHTML="",!f&&u.promptText.length>0?p.Obj.append(""):f||p.Obj.append("");break;case t.dropdownType.complex:d=f?"":u.noneText+"|0",p.Obj.val("");break;case t.dropdownType.multiSelect:e(p.master.candidateControl).find("option").remove(),i=""}switch(s=parseFloat(e(o.responseXML).SPFilterNode("rs:data").attr("ItemCount")),e(o.responseXML).SPFilterNode("z:row").each(function(){var o={},r=e(this).attr("ows_"+u.relationshipListChildColumn);switch("undefined"!=typeof r&&r.indexOf(t.spDelim)>0?o=new a.SplitIndex(r):(o.id=e(this).attr("ows_ID"),o.value=r),isNaN(o.id)&&(o.id=e(this).attr("ows_ID")),n=o.id,l=o.value,p.Type){case t.dropdownType.simple:var s=e(this).attr("ows_ID")===c[0]?" selected='selected'":"";p.Obj.append(""+o.value+"");break;case t.dropdownType.complex:o.id===c[0]&&p.Obj.val(o.value),d=d+(d.length>0?"|":"")+o.value+"|"+o.id;break;case t.dropdownType.multiSelect:e(p.master.candidateControl).append(""),i+=o.id+"|t"+o.value+"|t |t |t"}}),p.Type){case t.dropdownType.simple:p.Obj.trigger("change"),1===s&&u.selectSingleOption===!0&&e(p.Obj).find("option[value!='0']:first").attr("selected","selected");break;case t.dropdownType.complex:p.Obj.attr("choices",d),1===s&&u.selectSingleOption===!0&&(e(p.Obj).val(l),p.optHid.val(n)),""===p.Obj.val()&&p.optHid.val("");break;case t.dropdownType.multiSelect:p.master.data="",p.MultiLookupPickerdata.val(i),e(p.master.resultControl).find("option").each(function(){var t=e(this);t.prop("selected",!0),e(p.master.candidateControl).find("option[value='"+t.val()+"']").each(function(){t.prop("selected",!1)})}),GipRemoveSelectedItems(p.master),e(p.master.candidateControl).find("option").each(function(){var t=e(this);e(p.master.resultControl).find("option[value='"+t.val()+"']").each(function(){t.remove()})}),GipAddSelectedItems(p.master),p.master.data=GipGetGroupData(i),e(p.master.candidateControl).trigger("dblclick")}}}),null!==u.completefunc&&u.completefunc()}})}return e.fn.SPServices.SPCascadeDropdowns=function(r){var i=e.extend({},{relationshipWebURL:"",relationshipList:"",relationshipListParentColumn:"",relationshipListChildColumn:"",relationshipListSortColumn:"",parentColumn:"",childColumn:"",listName:e().SPServices.SPListNameFromUrl(),CAMLQuery:"",CAMLQueryOptions:"FALSE",promptText:"",noneText:"(None)",simpleChild:!1,selectSingleOption:!1,matchOnId:!1,completefunc:null,debug:!1},r),s=!1,n="SPServices.SPCascadeDropdowns",l=e().SPServices.SPDropdownCtl({displayName:i.parentColumn});if(null===l.Obj.html()&&i.debug)return void a.errBox(n,"parentColumn: "+i.parentColumn,t.TXTColumnNotFound);var d=e().SPServices.SPDropdownCtl({displayName:i.childColumn});if(null===d.Obj.html()&&i.debug)return void a.errBox(n,"childColumn: "+i.childColumn,t.TXTColumnNotFound);i.simpleChild===!0&&d.Type===t.dropdownType.complex&&(e().SPServices.SPComplexToSimpleDropdown({listName:i.listName,columnName:i.childColumn}),d=e().SPServices.SPDropdownCtl({displayName:i.childColumn}));var c,m;e().SPServices({operation:"GetList",async:!1,cacheXML:!0,listName:i.listName,completefunc:function(t){e(t.responseXML).find("Fields").each(function(){e(this).find("Field[DisplayName='"+i.childColumn+"']").each(function(){return c="TRUE"===e(this).attr("Required"),m=e(this).attr("StaticName"),!1})})}});var u={opt:i,childSelect:d,childColumnStatic:m,childColumnRequired:c},p=l.Obj.data("SPCascadeDropdownsChildColumns");if("undefined"==typeof p?l.Obj.data("SPCascadeDropdownsChildColumns",[u]):(p.push(u),l.Obj.data("SPCascadeDropdownsChildColumns",p),s=!0),!s)switch(l.Type){case t.dropdownType.simple:l.Obj.bind("change",function(){o(l)});break;case t.dropdownType.complex:l.optHid.bind("propertychange",function(){o(l)});break;case t.dropdownType.multiSelect:e(l.master.candidateControl).bind("dblclick",function(){o(l)}),e(l.master.resultControl).bind("dblclick",function(){o(l)}),e(l.master.addControl).bind("click",function(){o(l)}),e(l.master.removeControl).bind("click",function(){o(l)})}o(l)},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";return e.fn.SPServices.SPComplexToSimpleDropdown=function(o){var r=e.extend({},{listName:e().SPServices.SPListNameFromUrl(),columnName:"",completefunc:null,debug:!1},o),i=e().SPServices.SPDropdownCtl({displayName:r.columnName});if(null===i.Obj.html()&&r.debug)return void a.errBox("SPServices.SPComplexToSimpleDropdown","columnName: "+r.columnName,t.TXTColumnNotFound);if(i.Type===t.dropdownType.complex){for(var s=e(i.Obj).attr("choices").split("|"),n=i.optHid.val(),l=a.genContainerId("SPComplexToSimpleDropdown",i.Obj.attr("title"),r.listName),d="",i.Obj.closest("td").prepend(d);var u=e("#"+l);i.Obj.closest("span").find("img").remove(),i.Obj.closest("span").find("input").hide(),u.change(function(){var t=e(this).val();i.optHid.val(t),e(i.Obj).val(e(this).find("option[value='"+("0"!==t?t:"")+"']").html())}),u.trigger("change"),null!==r.completefunc&&r.completefunc()}},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";function o(o,i,s){var n,l,d="SPServices.SPDisplayRelatedInfo",c=e().SPServices.SPDropdownCtl({displayName:o.columnName});if(l=a.getDropdownSelected(c,o.matchOnId),!(c.Type===t.dropdownType.complex&&o.numChars>0&&l[0].length
    ")}var u="";o.CAMLQuery.length>0&&(u+="");var p=s[o.relatedListColumn].attr("Type");u+="Lookup"===p?"":"'/>")+a.escapeColumnValue(l[0])+"":"":o.relatedListColumn+"'/>")+a.escapeColumnValue(l[0])+"",o.CAMLQuery.length>0&&(u+=o.CAMLQuery+""),u+="";var S=" ";for(n=0;n";e().SPServices({operation:"GetListItems",async:!1,webURL:o.relatedWebURL,listName:o.relatedList,CAMLQuery:u,CAMLViewFields:""+S+"",CAMLRowLimit:0,completefunc:function(t){e(t.responseXML).find("errorstring").each(function(){var t=e(this).text();o.debug&&"One or more field types are not installed properly. Go to the list settings page to delete these fields."===t?a.errBox(d,"relatedListColumn: "+o.relatedListColumn,"Column not found in relatedList "+o.relatedList):o.debug&&"Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."===t&&a.errBox(d,"relatedList: "+o.relatedList,"List not found")});var l;switch(o.displayFormat){case"table":for(l="",l+="",n=0;n"+s[o.relatedColumns[n]].attr("DisplayName")+""}l+="",e(t.responseXML).SPFilterNode("z:row").each(function(){for(l+="",n=0;n"+r(i,s[o.relatedColumns[n]],e(this).attr("ows_"+o.relatedColumns[n]),o)+"";l+=""}),l+="
    ";break;case"list":l="",e(t.responseXML).SPFilterNode("z:row").each(function(){for(n=0;n"+s[o.relatedColumns[n]].attr("DisplayName")+"",l+="",l+=""}}),l+="
    "+r(i,s[o.relatedColumns[n]],e(this).attr("ows_"+o.relatedColumns[n]),o)+"
    ";break;case"none":}"none"!==o.displayFormat&&e("#"+m).html(l),null!==o.completefunc&&o.completefunc(t)}})}}function r(o,r,i,s){if("undefined"==typeof i)return"";var n,l,d,c="",m="",u=[],p=s.relatedWebURL.length>0?s.relatedWebURL:e().SPServices.SPGetCurrentSite();switch(r.attr("Type")){case"Text":c=i;break;case"URL":switch(r.attr("Format")){case"Hyperlink":c=""+i.substring(i.search(",")+1)+"";break;case"Image":c=""+i.substring(i.search(",")+1)+"";break;default:c=i}break;case"User":case"UserMulti":var S=i.split(t.spDelim);for(n=0;n"+S[n+1]+"");c=u.join(", ");break;case"Calculated":var f=i.split(t.spDelim);c=f[1];break;case"Number":d=r.attr("Decimals"),c="undefined"==typeof d?parseFloat(i).toString():parseFloat(i).toFixed(d).toString();break;case"Currency":d=r.attr("Decimals"),c="undefined"==typeof d?parseFloat(i).toFixed(2).toString():parseFloat(i).toFixed(d).toString();break;case"Lookup":switch(r.attr("Name")){case"FileRef":l="1"===o.attr("BaseType")?o.attr("RootFolder")+t.SLASH+"Forms/DispForm.aspx":o.attr("RootFolder")+t.SLASH+"DispForm.aspx",c=""+i.substring(i.search(t.spDelim)+2)+"";break;case"FileDirRef":l=t.SLASH+i.substring(i.search(t.spDelim)+2),c=""+i.substring(i.search(t.spDelim)+2)+"";break;default:l=a.getListFormUrl(r.attr("List"),"DisplayForm"),c=""+i.substring(i.search(t.spDelim)+2)+""}break;case"LookupMulti":if(l=a.getListFormUrl(r.attr("List"),"DisplayForm"),c="",i.length>0){var y=i.split(t.spDelim);for(n=0;n"+y[2*n+1]+"")}c=u.join(", ");break;case"File":m=i.substring(i.search(t.spDelim)+2),c=""+m+"";break;case"Counter":c=i;break;case"DateTime":c=i;break;default:c=i}return c}return e.fn.SPServices.SPDisplayRelatedInfo=function(r){var i,s,n=e.extend({},{listName:e().SPServices.SPListNameFromUrl(),columnName:"",relatedWebURL:"",relatedList:"",relatedListColumn:"",relatedColumns:[],displayFormat:"table",headerCSSClass:"ms-vh2",rowCSSClass:"ms-vb",CAMLQuery:"",numChars:0,matchType:"Eq",matchOnId:!1,completefunc:null,debug:!1},r),l=[],d="SPServices.SPDisplayRelatedInfo",c=e().SPServices.SPDropdownCtl({displayName:n.columnName});if(null===c.Obj.html()&&n.debug)return void a.errBox(d,"columnName: "+n.columnName,t.TXTColumnNotFound);switch(e().SPServices({operation:"GetList",async:!1,cacheXML:!0,webURL:n.relatedWebURL,listName:n.relatedList,completefunc:function(t){for(e(t.responseXML).find("faultcode").each(function(){n.debug&&a.errBox(d,"relatedList: "+n.relatedList,"List not found")}),s=e(t.responseXML).find("List"),i=0;i Field[Name='"+n.relatedColumns[i]+"']");l[n.relatedListColumn]=e(t.responseXML).find("Fields > Field[Name='"+n.relatedListColumn+"']")}}),c.Type){case t.dropdownType.simple:c.Obj.bind("change",function(){o(n,s,l)});break;case t.dropdownType.complex:c.optHid.bind("propertychange",function(){o(n,s,l)});break;case t.dropdownType.multiSelect:n.debug&&a.errBox(d,"columnName: "+n.columnName,"Multi-select columns not supported by this function")}o(n,s,l)},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";return e.fn.SPServices.SPFilterDropdown=function(o){var r,i,s=e.extend({},{relationshipWebURL:"",relationshipList:"",relationshipListColumn:"",relationshipListSortColumn:"",relationshipListSortAscending:!0,columnName:"",listName:e().SPServices.SPListNameFromUrl(),promptText:"",noneText:"(None)",CAMLQuery:"",CAMLQueryOptions:"FALSE",completefunc:null,debug:!1},o),n="",l=null,d="SPServices.SPFilterDropdown",c=e().SPServices.SPDropdownCtl({displayName:s.columnName});if(null===c.Obj.html()&&s.debug)return void a.errBox(d,"columnName: "+s.columnName,t.TXTColumnNotFound);l=a.getDropdownSelected(c,!0);var m=s.relationshipListSortColumn.length>0?s.relationshipListSortColumn:s.relationshipListColumn,u=s.relationshipListSortAscending===!0?"":"Ascending='FALSE'",p="";s.CAMLQuery.length>0&&(p+=s.CAMLQuery),p+="",e().SPServices({operation:"GetList",async:!1,cacheXML:!0,listName:s.listName,completefunc:function(t){e(t.responseXML).find("Fields").each(function(){e(this).find("Field[DisplayName='"+s.columnName+"']").each(function(){return i="TRUE"===e(this).attr("Required"),!1})})}}),e().SPServices({operation:"GetListItems",async:!1,webURL:s.relationshipWebURL,listName:s.relationshipList,CAMLQuery:p,CAMLViewFields:"",CAMLRowLimit:0,CAMLQueryOptions:s.CAMLQueryOptions,completefunc:function(o){switch(e(o.responseXML).find("errorstring").each(function(){var t=e(this).text();s.debug&&"One or more field types are not installed properly. Go to the list settings page to delete these fields."===t?a.errBox(d,"relationshipListColumn: "+s.relationshipListColumn,"Not found in relationshipList "+s.relationshipList):s.debug&&"Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."===t&&a.errBox(d,"relationshipList: "+s.relationshipList,"List not found")}),c.Type){case t.dropdownType.simple:e(c.Obj).find("option").remove(),!i&&s.promptText.length>0?c.Obj.append(""):i||c.Obj.append("");break;case t.dropdownType.complex:n=i?"":s.noneText+"|0",c.Obj.val("");break;case t.dropdownType.multiSelect:e(c.master.candidateControl).find("option").remove(),r=""}switch(e(o.responseXML).SPFilterNode("z:row").each(function(){var o={},i=e(this).attr("ows_"+s.relationshipListColumn);switch("undefined"!=typeof i&&i.indexOf(t.spDelim)>0?o=new a.SplitIndex(i):(o.id=e(this).attr("ows_ID"),o.value=i),isNaN(o.id)&&(o.id=e(this).attr("ows_ID")),c.Type){case t.dropdownType.simple:var d=e(this).attr("ows_ID")===l[0]?" selected='selected'":"";c.Obj.append(""+o.value+"");break;case t.dropdownType.complex:o.id===l[0]&&c.Obj.val(o.value),n=n+(n.length>0?"|":"")+o.value+"|"+o.id;break;case t.dropdownType.multiSelect:e(c.master.candidateControl).append(""),r+=o.id+"|t"+o.value+"|t |t |t"}}),c.Type){case t.dropdownType.simple:c.Obj.trigger("change");break;case t.dropdownType.complex:c.Obj.attr("choices",n),c.Obj.trigger("propertychange");break;case t.dropdownType.multiSelect:c.master.data="",c.MultiLookupPickerdata.val(r),e(c.master.resultControl).find("option").each(function(){var t=e(this);e(this).attr("selected","selected"),e(c.master.candidateControl).find("option").each(function(){e(this).html()===t.html()&&t.removeAttr("selected")})}),GipRemoveSelectedItems(c.master),e(c.master.candidateControl).find("option").each(function(){var t=e(this);e(c.master.resultControl).find("option").each(function(){e(this).html()===t.html()&&t.remove()})}),GipAddSelectedItems(c.master),c.master.data=GipGetGroupData(r),e(c.master.candidateControl).trigger("dblclick")}}}),null!==s.completefunc&&s.completefunc()},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(1)],r=function(e){"use strict";return e.fn.SPServices.SPFindMMSPicker=function(t){for(var a=e.extend({},{MMSDisplayName:""},t),o=[],r=e("div[title='"+a.MMSDisplayName+"']"),i=r.closest("td").find("input[type='hidden']"),s=i.val().split(";"),n=0;n0&&r.html(a.valueToSet),a.checkNames&&i.click();var s=e.trim(r.text()),n=[];return r.children("span").each(function(){var t=e(this).find("div[data]").attr("data"),a={};if("undefined"!=typeof t){var o=e.parseXML(t),r=e(o);r.find("DictionaryEntry").each(function(){var t=e(this).find("Key").text();a[t]=e(this).find("Value").text()}),n.push(a)}else e().SPServices({operation:"GetUserInfo",async:!1,cacheXML:!0,userLoginName:e(this).attr("title"),completefunc:function(t){e(t.responseXML).find("User").each(function(){e.each(this.attributes,function(e,t){a[t.name]=t.value}),n.push(a)})}})}),{row:o,contents:r,currentValue:s,checkNames:i,dictionaryEntries:n}},e.fn.SPFindPeoplePicker=function(t){return e().SPServices.SPFindPeoplePicker(t)},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";return e.fn.SPServices.SPLookupAddNew=function(o){var r=e.extend({},{lookupColumn:"",promptText:"Add new {0}",newWindow:!1,ContentTypeID:"",completefunc:null,debug:!1},o),i="SPServices.SPLookupAddNew",s=e().SPServices.SPDropdownCtl({displayName:r.lookupColumn});if(null===s.Obj.html()&&r.debug)return void a.errBox(i,"lookupColumn: "+r.lookupColumn,t.TXTColumnNotFound);var n="",l="",d="";if(e().SPServices({operation:"GetList",async:!1,cacheXML:!0,listName:e().SPServices.SPListNameFromUrl(),completefunc:function(o){e(o.responseXML).find("Field[DisplayName='"+r.lookupColumn+"']").each(function(){return d=e(this).attr("StaticName"),e().SPServices({operation:"GetList",async:!1,cacheXML:!0,listName:e(this).attr("List"),completefunc:function(a){e(a.responseXML).find("List").each(function(){l=e(this).attr("WebFullUrl"),l=l!==t.SLASH?l+t.SLASH:l})}}),n=a.getListFormUrl(e(this).attr("List"),"NewForm"),!1})}}),0===l.length&&r.debug)return void a.errBox(i,"lookupColumn: "+r.lookupColumn,"This column does not appear to be a lookup column");if(n.length>0){var c=l+n;c+=r.newWindow?(r.ContentTypeID.length>0?"?ContentTypeID="+r.ContentTypeID:"")+"' target='_blank'":"?"+(r.ContentTypeID.length>0?"ContentTypeID="+r.ContentTypeID+"&":"")+"Source="+a.escapeUrl(location.href)+"'";var m="
    0?location.href.substring(0,location.href.indexOf("?")):location.href,t="string"==typeof r.Source?"Source="+r.Source.replace(/\//g,"%2f").replace(/:/g,"%3a"):"",a=[];"undefined"!=typeof s&&a.push("List="+s),"undefined"!=typeof n&&a.push("RootFolder="+n),"undefined"!=typeof l&&a.push("ContentTypeId="+l);var o=e+(a.length>0?"?"+a.join("&")+"&":"?")+"Source="+e+"?ID="+i+(t.length>0?"%26RealSource="+r.Source:"")+("string"==typeof r.RedirectURL?"%26RedirectURL="+r.RedirectURL:"");setTimeout(function(){document.forms.aspnetForm.action=o},0)});else{for(;r.ID===i;)i=e().SPServices.SPGetLastItemId({listName:o});var d="string"==typeof r.RedirectURL?r.RedirectURL:a.redirectUrl;location.href=d+"?"+a.qsParamName+"="+i+("string"==typeof r.RealSource?"&Source="+r.RealSource:"")}},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(4),a(1)],r=function(e,t){"use strict";return e.fn.SPServices.SPRequireUnique=function(a){var o=e.extend({},{columnStaticName:"Title",duplicateAction:0,ignoreCase:!1,initMsg:"This value must be unique.",initMsgCSSClass:"ms-vb",errMsg:"This value is not unique.",errMsgCSSClass:"ms-formvalidation",showDupes:!1,completefunc:null},a),r=e().SPServices.SPGetQueryString(),i=r.ID,s=e().SPServices.SPListNameFromUrl(),n="{1}
    ",l=n.replace(/\{0\}/g,o.initMsgCSSClass).replace(/\{1\}/g,o.initMsg),d=e().SPServices.SPGetDisplayFromStatic({listName:s,columnStaticName:o.columnStaticName}),c=t.findFormField(d).find("input[Title^='"+d+"']");c.parent().append(l),c.blur(function(){var t=[],a=e(this).val();if(0===a.length)return!1;e().SPServices({operation:"GetListItems",async:!1,listName:s,CAMLQuery:"",CAMLViewFields:"",CAMLRowLimit:0,completefunc:function(r){var s=o.ignoreCase?a.toUpperCase():a;e(r.responseXML).SPFilterNode("z:row").each(function(){var a=o.ignoreCase?e(this).attr("ows_"+o.columnStaticName).toUpperCase():e(this).attr("ows_"+o.columnStaticName);s===a&&e(this).attr("ows_ID")!==i&&t.push([e(this).attr("ows_ID"),e(this).attr("ows_"+o.columnStaticName)])})}});var r=o.initMsg,n=e("#SPRequireUnique"+o.columnStaticName);if(n.html(r).attr("class",o.initMsgCSSClass),e("input[value='OK']:disabled, input[value='Save']:disabled").removeAttr("disabled"),t.length>0&&(r=o.errMsg,n.html(r).attr("class",o.errMsgCSSClass),1===o.duplicateAction&&(c.focus(),e("input[value='OK'], input[value='Save']").attr("disabled","disabled")),o.showDupes)){for(var l=" "+t.length+" duplicate item"+(t.length>1?"s":"")+": ",d=0;d"+t[d][1]+"
    ";e("span#SPRequireUnique"+o.columnStaticName).append(l)}}),null!==o.completefunc&&o.completefunc()},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";function o(o,s,n,l,d){var c=0,m={};m.type=[],m.src=[],m.script=[];var u=RegExp("","gi");e.ajax({type:"GET",url:d,dataType:"text",async:!1,success:function(p){for(var S;S=u.exec(p);){var f=r(S,"language"),y=r(S,"type"),h=r(S,"src");null!==h&&h.length>0&&!i(h)&&(m.type.push(null!==f&&f.length>0?f:y),m.src.push(h),c++)}if(!o.showNoScript&&m.type.length>0||o.showNoScript){var T=d.substring(0,d.lastIndexOf(t.SLASH)+1),P=""+s.attr("Title")+("True"===s.attr("Hidden")?"(Hidden)":"")+""+n+""+l+""+a.fileName(d)+"";if(o.showSrc){var b;P+="";for(var C=0;C",P+="";P+="
    "+m.type[C]+""+a.fileName(m.src[C])+"
    "}e("#SPScriptAudit").append(P)}}})}function r(e,t){var a,o=RegExp(t+"=(\"([^\"]*)\")|('([^']*)')","gi");return(a=o.exec(e))?a[2]:null}function i(e){for(var t=["WebResource.axd","_layouts"],a=0;a-1)return!0;return!1}return e.fn.SPServices.SPScriptAudit=function(a){var r,i=e.extend({},{webURL:"",listName:"",outputId:"",auditForms:!0,auditViews:!0,auditPages:!0,auditPagesListName:"Pages",showHiddenLists:!1,showNoScript:!1,showSrc:!0},a),s=[["New","NewForm.aspx",!1],["Display","DispForm.aspx",!1],["Edit","EditForm.aspx",!1]];e("#"+i.outputId).append(""+(i.showSrc?"":"")+"
    ListPage ClassPage TypePageScript References
    ");var n=e("#SPScriptAudit");n.find("th").attr("class","ms-vh2-nofilter"),(i.auditForms||i.auditViews)&&e().SPServices({operation:"GetListCollection",webURL:i.webURL,async:!1,completefunc:function(a){e(a.responseXML).find("List").each(function(){ +r=e(this),0!==i.listName.length&&r.attr("Title")!==i.listName||(i.showHiddenLists&&"False"===r.attr("Hidden")||!i.showHiddenLists)&&(i.auditForms&&e().SPServices({operation:"GetListContentTypes",webURL:i.webURL,listName:r.attr("ID"),async:!1,completefunc:function(a){e(a.responseXML).find("ContentType").each(function(){if("0x0120"!==e(this).attr("ID").substring(0,6)){for(var a=e(this).find("FormUrls"),n=0;n0?i.webURL:e().SPServices.SPGetCurrentSite())+t.SLASH+e(this).text()),s[n][2]=!0}),!s[n][2]){var l=r.attr("DefaultViewUrl");o(i,r,"Form",s[n][0],l.substring(0,l.lastIndexOf(t.SLASH)+1)+s[n][1])}for(n=0;nc;c++)e().SPServices({operation:"GetList",async:!1,cacheXML:!0,webURL:i.webURL,listName:d[c],completefunc:function(t){e(t.responseXML).find("List").each(function(){r=e(this)})}}),e().SPServices({operation:"GetListItems",async:!1,webURL:i.webURL,listName:d[c],CAMLQuery:"Folder",CAMLViewFields:"",CAMLRowLimit:0,completefunc:function(a){e(a.responseXML).SPFilterNode("z:row").each(function(){var a=e(this).attr("ows_FileRef").split(t.spDelim)[1],s=e(this).attr("ows_Title"),n="undefined"!=typeof s?s:"";a.indexOf(".aspx")>0&&o(i,r,"Page",n,t.SLASH+a)})}});n.find("tr[class='ms-alternating']:even").removeAttr("class")},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";return e.fn.SPServices.SPSetMultiSelectSizes=function(o){var r=e.extend({},{listName:e().SPServices.SPListNameFromUrl(),multiSelectColumn:"",minWidth:0,maxWidth:0,debug:!1},o),i="SPServices.SPSetMultiSelectSizes",s=e().SPServices.SPDropdownCtl({displayName:r.multiSelectColumn});if(null===s.Obj.html()&&r.debug)return void a.errBox(i,"multiSelectColumn: "+r.multiSelectColumn,t.TXTColumnNotFound);if(s.Type!==t.dropdownType.multiSelect&&r.debug)return void a.errBox(i,"multiSelectColumn: "+r.multiSelectColumn,"Column is not multi-select.");var n=a.genContainerId("SPSetMultiSelectSizes",r.multiSelectColumn,r.listName),l=e("").appendTo(s.container);l.css({width:"auto",height:0,visibility:"hidden"}),e(s.master.candidateControl).find("option").each(function(){l.append("")}),e(s.master.resultControl).find("option").each(function(){l.append("")});var d=l.width()+5,c=d;(r.minWidth>0||r.maxWidth>0)&&(dr.maxWidth&&(c=r.maxWidth));var m=d;e(s.master.candidateControl).css("width",m+"px").parent().css("width",c+"px"),e(s.master.resultControl).css("width",m+"px").parent().css("width",c+"px"),l.remove()},e}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,a){var o,r;o=[a(2),a(3),a(4),a(1)],r=function(e,t,a){"use strict";return e.fn.SPServices.SPUpdateMultipleListItems=function(o){var r,i=e.extend({},{webURL:"",listName:"",CAMLQuery:"",batchCmd:"Update",valuepairs:[],completefunc:null,debug:!1},o),s=[],n=[];e().SPServices({operation:"GetListItems",async:!1,webURL:i.webURL,listName:i.listName,CAMLQuery:i.CAMLQuery,CAMLQueryOptions:"",completefunc:function(a){e(a.responseXML).SPFilterNode("z:row").each(function(){s.push(e(this).attr("ows_ID"));var a=e(this).attr("ows_FileRef");a="/"+a.substring(a.indexOf(t.spDelim)+2),n.push(a)})}});var l,d="";for(r=0;r",l=0;l"+a.escapeColumnValue(i.valuepairs[l][1])+"";d+=""+s[r]+"",n[r].length>0&&(d+=""+n[r]+""),d+=""}d+="",e().SPServices({operation:"UpdateListItems",async:!1,webURL:i.webURL,listName:i.listName,updates:d,completefunc:function(e){null!==i.completefunc&&i.completefunc(e)}})},e}.apply(t,o),!(void 0!==r&&(e.exports=r))}]); \ No newline at end of file diff --git a/src/core/SPServices.core.js b/src/core/SPServices.core.js index 2b6bda0..7f0dace 100644 --- a/src/core/SPServices.core.js +++ b/src/core/SPServices.core.js @@ -50,7 +50,9 @@ define([ VIEWS: "Views", WEBPARTPAGES: "WebPartPages", WEBS: "Webs", - WORKFLOW: "Workflow" + WORKFLOW: "Workflow", + /* Nintex Web Service*/ + NINTEXWORKFLOW: "NintexWorkflow/Workflow" }; var encodeOptionList = ["listName", "description"]; // Used to encode options which may contain special characters @@ -324,6 +326,71 @@ define([ WSops.GetWorkflowTaskData = [webServices.WORKFLOW, false]; WSops.StartWorkflow = [webServices.WORKFLOW, true]; + //Nintex + WSops.AddLongTermDelegationRule = [webServices.NINTEXWORKFLOW, true]; + WSops.AddWorkflowSchedule = [webServices.NINTEXWORKFLOW, true]; + WSops.AddWorkflowScheduleOnListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.CheckGlobalReuseStatus = [webServices.NINTEXWORKFLOW, true]; + WSops.CheckInForms = [webServices.NINTEXWORKFLOW, true]; + WSops.DelegateAllTasks = [webServices.NINTEXWORKFLOW, true]; + WSops.DelegateTask = [webServices.NINTEXWORKFLOW, true]; + WSops.DeleteLongTermDelegationRule = [webServices.NINTEXWORKFLOW, true]; + WSops.DeleteSnippet = [webServices.NINTEXWORKFLOW, true]; + WSops.DeleteWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.ExportWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.FixWorkflowsInSiteFromTemplate = [webServices.NINTEXWORKFLOW, true]; + WSops.GetFolders = [webServices.NINTEXWORKFLOW, true]; + WSops.GetItemsPendingMyApproval = [webServices.NINTEXWORKFLOW, true]; + WSops.GetListContentTypes = [webServices.NINTEXWORKFLOW, true]; + WSops.GetOutcomesForFlexiTask = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasks = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasksCollection = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasksForCurrentUser = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasksForCurrentUserForListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.GetRunningWorkflowTasksForListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.GetTaskDetailsUsingStub = [webServices.NINTEXWORKFLOW, true]; + WSops.GetTaskStubsForCurrentUser = [webServices.NINTEXWORKFLOW, true]; + WSops.GetWorkflowHistory = [webServices.NINTEXWORKFLOW, true]; + WSops.GetWorkflowHistoryForListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.HideTaskForApprover = [webServices.NINTEXWORKFLOW, true]; + WSops.HideWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessFlexiTaskResponse = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessFlexiTaskResponse2 = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessTaskResponse = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessTaskResponse2 = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessTaskResponse3 = [webServices.NINTEXWORKFLOW, true]; + WSops.ProcessTaskResponseUsingToken = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWF = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFSkipValidation = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFSkipValidationNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFXml = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFXmlNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFXmlSkipValidation = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishFromNWFXmlSkipValidationNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.PublishWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.QueryForMessages = [webServices.NINTEXWORKFLOW, true]; + WSops.RemoveWorkflowSchedule = [webServices.NINTEXWORKFLOW, true]; + WSops.RemoveWorkflowScheduleOnListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveFromNWF = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveFromNWFNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveFromNWFXml = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveFromNWFXmlNoOverwrite = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveSnippet = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveTemplate = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveTemplate2 = [webServices.NINTEXWORKFLOW, true]; + WSops.SaveWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.SnippetExists = [webServices.NINTEXWORKFLOW, true]; + WSops.StartSiteWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.NintexStartWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.StartWorkflowOnListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.TemplateExists = [webServices.NINTEXWORKFLOW, true]; + WSops.TerminateWorkflow = [webServices.NINTEXWORKFLOW, true]; + WSops.TerminateWorkflowByName = [webServices.NINTEXWORKFLOW, true]; + WSops.TerminateWorkflowByNameForListItem = [webServices.NINTEXWORKFLOW, true]; + WSops.WorkflowExists = [webServices.NINTEXWORKFLOW, true]; + WSops.WorkflowFormProductSelected = [webServices.NINTEXWORKFLOW, true]; + // Main function, which calls SharePoint's Web Services directly. $.fn.SPServices = function (options) { @@ -1295,6 +1362,323 @@ define([ } }; // End $.fn.SPServices + + //Main function which calls Nintex's Web Services directly + $.fn.NintexServices = function (options) + { + // If there are no options passed in, use the defaults. Extend replaces each default with the passed option. + var opt = $.extend({}, $.fn.SPServices.defaults, options); + + // Encode options which may contain special character, esp. ampersand + for (var i = 0; i < encodeOptionList.length; i++) { + if (typeof opt[encodeOptionList[i]] === "string") { + opt[encodeOptionList[i]] = utils.encodeXml(opt[encodeOptionList[i]]); + } + }//end for + + // Put together operation header and SOAPAction for the SOAP call based on which Web Service we're calling + SOAPEnvelope.opheader = "<" + opt.operation + " "; + switch (WSops[opt.operation][0]) { + case webServices.NINTEXWORKFLOW: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMANintex + "'>"; + SOAPAction = constants.SCHEMANintex + "/"; + break; + default: + SOAPEnvelope.opheader += "xmlns='" + constants.SCHEMANintex + "/soap/'>"; + SOAPAction = constants.SCHEMANintex + "/soap/"; + break; + }//end switch + + // Add the operation to the SOAPAction and opfooter + SOAPAction += opt.operation; + SOAPEnvelope.opfooter = ""; + + // Build the URL for the Ajax call based on which operation we're calling + // If the webURL has been provided, then use it, else use the current site + var ajaxURL = "_vti_bin/" + WSops[opt.operation][0] + ".asmx"; + var thisSite = $().SPServices.SPGetCurrentSite(); + var webURL = opt.webURL !== undefined ? opt.webURL : opt.webUrl; + if (webURL.charAt(webURL.length - 1) === constants.SLASH) { + ajaxURL = webURL + ajaxURL; + } else if (webURL.length > 0) { + ajaxURL = webURL + constants.SLASH + ajaxURL; + } else { + ajaxURL = thisSite + ((thisSite.charAt(thisSite.length - 1) === constants.SLASH) ? ajaxURL : (constants.SLASH + ajaxURL)); + } + + SOAPEnvelope.payload = ""; + // Each operation requires a different set of values. This switch statement sets them up in the SOAPEnvelope.payload. + switch (opt.operation) { + //NINTEX WORKFLOW OPERATIONS + case "AddLongTermDelegationRule": + utils.addToPayload(opt,["fromTheBeginningOf","untilTheEndOf","delegateFrom","delegateTo","currentSiteOnly"]); + break; + case "AddWorkflowSchedule": + utils.addToPayload(opt,["fileUrl","workflowName","startDataXml"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["MaximumRepeats","WorkdaysOnly"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["Type","CountBetweenIntervals"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["EndOn","StartTime","EndTime"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["updateIfExists"]); + break; + case "AddWorkflowScheduleOnListItem": + utils.addToPayload(opt,["itemId","listName","workflowName","startDataXML"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["MaximumRepeats","WorkdaysOnly"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["Type","CountBetweenIntervals"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["EndOn","StartTime","EndTime"]); + SOAPEnvelope.payload += ""; + utils.addToPayload(opt,["updateIfExists"]); + break; + case "CheckGlobalReuseStatus": + utils.addToPayload(opt,["workflowName"]); + break; + case "CheckInForms": + utils.addToPayload(opt,["workflowConfiguration","activityConfiguration","formType"]); + break; + case "DelegateAllTasks": + utils.addToPayload(opt,["currentUser","newUser","sendNotification","comments","global"]); + break; + case "DelegateTask": + utils.addToPayload(opt,["spTaskId","taskListName","targetUserName","comments","sendNotification"]); + break; + case "DeleteLongTermDelegationRule": + utils.addToPayload(opt,["id"]); + break; + case "DeleteSnippet": + utils.addToPayload(opt,["snippetId"]); + break; + case "DeleteWorkflow": + utils.addToPayload(opt,["listId","workflowId","workflowType"]); + break; + case "ExportWorkflow": + utils.addToPayload(opt,["listName","workflowType","workflowName"]); + break; + case "FixWorkflowsInSiteFromTemplate": + utils.addToPayload(opt,["FixWorkflowsInSiteFromTemplate"]); + break; + case "GetFolders": + utils.addToPayload(opt,["listGuid"]); + break; + case "GetItemsPendingMyApproval": + utils.addToPayload(opt,["uniquenessInfo"]); + break; + case "GetListContentTypes": + utils.addToPayload(opt,["listGuid"]); + break; + case "GetOutcomesForFlexiTask": + utils.addToPayload(opt,["spTaskId","taskListName"]); + break; + case "GetRunningWorkflowTasks": + utils.addToPayload(opt,["fileUrl"]); + break; + case "GetRunningWorkflowTasksCollection": + utils.addToPayload(opt,["userlogin","teamsiteUrl","listName"]); + break; + case "GetRunningWorkflowTasksForCurrentUser": + utils.addToPayload(opt,["fileUrl"]); + break; + case "GetRunningWorkflowTasksForCurrentUserForListItem": + utils.addToPayload(opt,["itemId","listName"]); + break; + case "GetRunningWorkflowTasksForListItem": + utils.addToPayload(opt,["itemId","listName"]); + break; + case "GetTaskDetailsUsingStub": + utils.addToPayload(opt,["taskToken"]); + break; + case "GetTaskStubsForCurrentUser": + break; + case "GetWorkflowHistory": + utils.addToPayload(opt,["fileUrl","stateFilter","workflowNameFilter"]); + break; + case "GetWorkflowHistoryForListItem": + utils.addToPayload(opt,["itemId","listName","stateFilter","workflowNameFilter"]); + break; + case "HideTaskForApprover": + utils.addToPayload(opt,["approverId","contentDbId"]); + break; + case "HideWorkflow": + utils.addToPayload(opt,["siteId","instanceId"]); + break; + case "ProcessFlexiTaskResponse": + utils.addToPayload(opt,["comments","outcome","spTaskId","taskListName"]); + break; + case "ProcessFlexiTaskResponse2": + utils.addToPayload(opt,["comments","outcome","spTaskId","taskListName"]); + break; + case "ProcessTaskResponse": + utils.addToPayload(opt,["comments","outcome","spTaskId"]); + break; + case "ProcessTaskResponse2": + utils.addToPayload(opt,["comments","outcome","spTaskId","taskListName"]); + break; + case "ProcessTaskResponse3": + utils.addToPayload(opt,["comments","outcome","spTaskId","taskListName"]); + break; + case "ProcessTaskResponseUsingToken": + utils.addToPayload(opt,["comments","outcome","taskToken","customOutcome"]); + break; + case "PublishFromNWF": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFSkipValidation": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFSkipValidationNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFXml": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFXmlNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFXmlSkipValidation": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishFromNWFXmlSkipValidationNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName","saveIfCannotPublish"]); + break; + case "PublishWorkflow": + utils.addToPayload(opt,["wfName","activityConfigs","listId","contentTypeId","changeNotes"]); + break; + case "QueryForMessages": + utils.addToPayload(opt,["workflowInstanceId","messageId"]); + break; + case "RemoveWorkflowSchedule": + utils.addToPayload(opt,["fileUrl","workflowName"]); + break; + case "RemoveWorkflowScheduleOnListItem": + utils.addToPayload(opt,["itemId","listName","workflowName"]); + break; + case "SaveFromNWF": + utils.addToPayload(opt,["workflowFile","listName","workflowName"]); + break; + case "SaveFromNWFNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName"]); + break; + case "SaveFromNWFXml": + utils.addToPayload(opt,["workflowFile","listName","workflowName"]); + break; + case "SaveFromNWFXmlNoOverwrite": + utils.addToPayload(opt,["workflowFile","listName","workflowName"]); + break; + case "SaveSnippet": + utils.addToPayload(opt,["snippetName","activityConfigs"]); + break; + case "SaveTemplate": + utils.addToPayload(opt,["templateName","templateDescription","category","activityConfigs"]); + break; + case "SaveTemplate2": + utils.addToPayload(opt,["templateName","templateDescription","category","activityConfigs","lcid"]); + break; + case "SaveWorkflow": + utils.addToPayload(opt,["wfName","activityConfigs","listId","contentTypeId","changeNotes"]); + break; + case "SnippetExists": + utils.addToPayload(opt,["snippetName"]); + break; + case "StartSiteWorkflow": + utils.addToPayload(opt,["workflowName","associationData"]); + break; + case "StartWorkflow": + utils.addToPayload(opt,["fileUrl","workflowName","associationData"]); + break; + case "StartWorkflowOnListItem": + utils.addToPayload(opt,["itemId","listName","workflowName","associationData"]); + break; + case "TemplateExists": + utils.addToPayload(opt,["templateName"]); + break; + case "TerminateWorkflow": + utils.addToPayload(opt,["listId","itemId","instanceId"]); + break; + case "TerminateWorkflowByName": + utils.addToPayload(opt,["fileUrl","workflowName","terminatePreviousInstances"]); + break; + case "TerminateWorkflowByNameForListItem": + utils.addToPayload(opt,["listName","itemId","workflowName","terminatePreviousInstances"]); + break; + case "WorkflowExists": + utils.addToPayload(opt,["workflowName","listId","workflowType"]); + break; + case "WorkflowFormProductSelected": + utils.addToPayload(opt,["workflowConfiguration","activityConfiguration","product","formType"]); + break; + default: + break; + }//end switch + + // Glue together the pieces of the SOAP message + var msg = SOAPEnvelope.header + SOAPEnvelope.opheader + SOAPEnvelope.payload + SOAPEnvelope.opfooter + SOAPEnvelope.footer; + + // Check to see if we've already cached the results + var cachedPromise; + if (opt.cacheXML) { + cachedPromise = promisesCache[msg]; + } + + if (typeof cachedPromise === "undefined") { + + // Finally, make the Ajax call + var p = $.ajax({ + // The relative URL for the AJAX call + url: ajaxURL, + // By default, the AJAX calls are asynchronous. You can specify false to require a synchronous call. + async: opt.async, + // Before sending the msg, need to send the request header + beforeSend: function (xhr) { + // If we need to pass the SOAPAction, do so + if (WSops[opt.operation][1]) { + xhr.setRequestHeader("SOAPAction", SOAPAction); + } + }, + // Always a POST + type: "POST", + // Here is the SOAP request we've built above + data: msg, + // We're getting XML; tell jQuery so that it doesn't need to do a best guess + dataType: "xml", + // and this is its content type + contentType: "text/xml;charset='utf-8'", + complete: function (xData, Status) { + // When the call is complete, call the completefunc if there is one + if ($.isFunction(opt.completefunc)) { + opt.completefunc(xData, Status); + + } + } + }); + if(opt.cacheXML) { + promisesCache[msg] = p; + } + + // Return the promise + return p; + + } else { + + // Call the completefunc if there is one + if ($.isFunction(opt.completefunc)) { + cachedPromise.done(function(data, status, jqXHR){ + opt.completefunc(jqXHR, status); + }); + + } + // Return the cached promise + return cachedPromise; + } + };//end NintexServices + // Defaults added as a function in our library means that the caller can override the defaults // for their session by calling this function. Each operation requires a different set of options; @@ -1341,4 +1725,4 @@ define([ }; // End $.fn.SPServices.defaults -}); +}); \ No newline at end of file diff --git a/src/utils/constants.js b/src/utils/constants.js index c2e6092..cf20ac2 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -21,6 +21,7 @@ define([], function () { // String constants // General SCHEMASharePoint: "http://schemas.microsoft.com/sharepoint", + SCHEMANintex: "http://nintex.com", multiLookupPrefix: "MultiLookupPicker", multiLookupPrefix2013: "MultiLookup", diff --git a/tests/jasmine/SpecRunner.html b/tests/jasmine/SpecRunner.html new file mode 100644 index 0000000..68016f6 --- /dev/null +++ b/tests/jasmine/SpecRunner.html @@ -0,0 +1,26 @@ + + + + + Jasmine Spec Runner v2.4.1 + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/jasmine/lib/jasmine-2.4.1/boot.js b/tests/jasmine/lib/jasmine-2.4.1/boot.js new file mode 100644 index 0000000..a99774d --- /dev/null +++ b/tests/jasmine/lib/jasmine-2.4.1/boot.js @@ -0,0 +1,130 @@ +/** + Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project. + + If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms. + + The location of `boot.js` can be specified and/or overridden in `jasmine.yml`. + + [jasmine-gem]: http://github.com/pivotal/jasmine-gem + */ + +(function() { + + /** + * ## Require & Instantiate + * + * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference. + */ + window.jasmine = jasmineRequire.core(jasmineRequire); + + /** + * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference. + */ + jasmineRequire.html(jasmine); + + /** + * Create the Jasmine environment. This is used to run all specs in a project. + */ + var env = jasmine.getEnv(); + + /** + * ## The Global Interface + * + * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged. + */ + var jasmineInterface = jasmineRequire.interface(jasmine, env); + + /** + * Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`. + */ + extend(window, jasmineInterface); + + /** + * ## Runner Parameters + * + * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface. + */ + + var queryString = new jasmine.QueryString({ + getWindowLocation: function() { return window.location; } + }); + + var catchingExceptions = queryString.getParam("catch"); + env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions); + + var throwingExpectationFailures = queryString.getParam("throwFailures"); + env.throwOnExpectationFailure(throwingExpectationFailures); + + var random = queryString.getParam("random"); + env.randomizeTests(random); + + var seed = queryString.getParam("seed"); + if (seed) { + env.seed(seed); + } + + /** + * ## Reporters + * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any). + */ + var htmlReporter = new jasmine.HtmlReporter({ + env: env, + onRaiseExceptionsClick: function() { queryString.navigateWithNewParam("catch", !env.catchingExceptions()); }, + onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); }, + onRandomClick: function() { queryString.navigateWithNewParam("random", !env.randomTests()); }, + addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); }, + getContainer: function() { return document.body; }, + createElement: function() { return document.createElement.apply(document, arguments); }, + createTextNode: function() { return document.createTextNode.apply(document, arguments); }, + timer: new jasmine.Timer() + }); + + /** + * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript. + */ + env.addReporter(jasmineInterface.jsApiReporter); + env.addReporter(htmlReporter); + + /** + * Filter which specs will be run by matching the start of the full name against the `spec` query param. + */ + var specFilter = new jasmine.HtmlSpecFilter({ + filterString: function() { return queryString.getParam("spec"); } + }); + + env.specFilter = function(spec) { + return specFilter.matches(spec.getFullName()); + }; + + /** + * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack. + */ + window.setTimeout = window.setTimeout; + window.setInterval = window.setInterval; + window.clearTimeout = window.clearTimeout; + window.clearInterval = window.clearInterval; + + /** + * ## Execution + * + * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded. + */ + var currentWindowOnload = window.onload; + + window.onload = function() { + if (currentWindowOnload) { + currentWindowOnload(); + } + htmlReporter.initialize(); + env.execute(); + }; + + /** + * Helper function for readability above. + */ + function extend(destination, source) { + for (var property in source) destination[property] = source[property]; + return destination; + } + +}()); diff --git a/tests/jasmine/lib/jasmine-2.4.1/console.js b/tests/jasmine/lib/jasmine-2.4.1/console.js new file mode 100644 index 0000000..e154806 --- /dev/null +++ b/tests/jasmine/lib/jasmine-2.4.1/console.js @@ -0,0 +1,190 @@ +/* +Copyright (c) 2008-2015 Pivotal Labs + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +function getJasmineRequireObj() { + if (typeof module !== 'undefined' && module.exports) { + return exports; + } else { + window.jasmineRequire = window.jasmineRequire || {}; + return window.jasmineRequire; + } +} + +getJasmineRequireObj().console = function(jRequire, j$) { + j$.ConsoleReporter = jRequire.ConsoleReporter(); +}; + +getJasmineRequireObj().ConsoleReporter = function() { + + var noopTimer = { + start: function(){}, + elapsed: function(){ return 0; } + }; + + function ConsoleReporter(options) { + var print = options.print, + showColors = options.showColors || false, + onComplete = options.onComplete || function() {}, + timer = options.timer || noopTimer, + specCount, + failureCount, + failedSpecs = [], + pendingCount, + ansi = { + green: '\x1B[32m', + red: '\x1B[31m', + yellow: '\x1B[33m', + none: '\x1B[0m' + }, + failedSuites = []; + + print('ConsoleReporter is deprecated and will be removed in a future version.'); + + this.jasmineStarted = function() { + specCount = 0; + failureCount = 0; + pendingCount = 0; + print('Started'); + printNewline(); + timer.start(); + }; + + this.jasmineDone = function() { + printNewline(); + for (var i = 0; i < failedSpecs.length; i++) { + specFailureDetails(failedSpecs[i]); + } + + if(specCount > 0) { + printNewline(); + + var specCounts = specCount + ' ' + plural('spec', specCount) + ', ' + + failureCount + ' ' + plural('failure', failureCount); + + if (pendingCount) { + specCounts += ', ' + pendingCount + ' pending ' + plural('spec', pendingCount); + } + + print(specCounts); + } else { + print('No specs found'); + } + + printNewline(); + var seconds = timer.elapsed() / 1000; + print('Finished in ' + seconds + ' ' + plural('second', seconds)); + printNewline(); + + for(i = 0; i < failedSuites.length; i++) { + suiteFailureDetails(failedSuites[i]); + } + + onComplete(failureCount === 0); + }; + + this.specDone = function(result) { + specCount++; + + if (result.status == 'pending') { + pendingCount++; + print(colored('yellow', '*')); + return; + } + + if (result.status == 'passed') { + print(colored('green', '.')); + return; + } + + if (result.status == 'failed') { + failureCount++; + failedSpecs.push(result); + print(colored('red', 'F')); + } + }; + + this.suiteDone = function(result) { + if (result.failedExpectations && result.failedExpectations.length > 0) { + failureCount++; + failedSuites.push(result); + } + }; + + return this; + + function printNewline() { + print('\n'); + } + + function colored(color, str) { + return showColors ? (ansi[color] + str + ansi.none) : str; + } + + function plural(str, count) { + return count == 1 ? str : str + 's'; + } + + function repeat(thing, times) { + var arr = []; + for (var i = 0; i < times; i++) { + arr.push(thing); + } + return arr; + } + + function indent(str, spaces) { + var lines = (str || '').split('\n'); + var newArr = []; + for (var i = 0; i < lines.length; i++) { + newArr.push(repeat(' ', spaces).join('') + lines[i]); + } + return newArr.join('\n'); + } + + function specFailureDetails(result) { + printNewline(); + print(result.fullName); + + for (var i = 0; i < result.failedExpectations.length; i++) { + var failedExpectation = result.failedExpectations[i]; + printNewline(); + print(indent(failedExpectation.message, 2)); + print(indent(failedExpectation.stack, 2)); + } + + printNewline(); + } + + function suiteFailureDetails(result) { + for (var i = 0; i < result.failedExpectations.length; i++) { + printNewline(); + print(colored('red', 'An error was thrown in an afterAll')); + printNewline(); + print(colored('red', 'AfterAll ' + result.failedExpectations[i].message)); + + } + printNewline(); + } + } + + return ConsoleReporter; +}; diff --git a/tests/jasmine/lib/jasmine-2.4.1/jasmine-html.js b/tests/jasmine/lib/jasmine-2.4.1/jasmine-html.js new file mode 100644 index 0000000..da23532 --- /dev/null +++ b/tests/jasmine/lib/jasmine-2.4.1/jasmine-html.js @@ -0,0 +1,473 @@ +/* +Copyright (c) 2008-2015 Pivotal Labs + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +jasmineRequire.html = function(j$) { + j$.ResultsNode = jasmineRequire.ResultsNode(); + j$.HtmlReporter = jasmineRequire.HtmlReporter(j$); + j$.QueryString = jasmineRequire.QueryString(); + j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter(); +}; + +jasmineRequire.HtmlReporter = function(j$) { + + var noopTimer = { + start: function() {}, + elapsed: function() { return 0; } + }; + + function HtmlReporter(options) { + var env = options.env || {}, + getContainer = options.getContainer, + createElement = options.createElement, + createTextNode = options.createTextNode, + onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {}, + onThrowExpectationsClick = options.onThrowExpectationsClick || function() {}, + onRandomClick = options.onRandomClick || function() {}, + addToExistingQueryString = options.addToExistingQueryString || defaultQueryString, + timer = options.timer || noopTimer, + results = [], + specsExecuted = 0, + failureCount = 0, + pendingSpecCount = 0, + htmlReporterMain, + symbols, + failedSuites = []; + + this.initialize = function() { + clearPrior(); + htmlReporterMain = createDom('div', {className: 'jasmine_html-reporter'}, + createDom('div', {className: 'jasmine-banner'}, + createDom('a', {className: 'jasmine-title', href: 'http://jasmine.github.io/', target: '_blank'}), + createDom('span', {className: 'jasmine-version'}, j$.version) + ), + createDom('ul', {className: 'jasmine-symbol-summary'}), + createDom('div', {className: 'jasmine-alert'}), + createDom('div', {className: 'jasmine-results'}, + createDom('div', {className: 'jasmine-failures'}) + ) + ); + getContainer().appendChild(htmlReporterMain); + }; + + var totalSpecsDefined; + this.jasmineStarted = function(options) { + totalSpecsDefined = options.totalSpecsDefined || 0; + timer.start(); + }; + + var summary = createDom('div', {className: 'jasmine-summary'}); + + var topResults = new j$.ResultsNode({}, '', null), + currentParent = topResults; + + this.suiteStarted = function(result) { + currentParent.addChild(result, 'suite'); + currentParent = currentParent.last(); + }; + + this.suiteDone = function(result) { + if (result.status == 'failed') { + failedSuites.push(result); + } + + if (currentParent == topResults) { + return; + } + + currentParent = currentParent.parent; + }; + + this.specStarted = function(result) { + currentParent.addChild(result, 'spec'); + }; + + var failures = []; + this.specDone = function(result) { + if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') { + console.error('Spec \'' + result.fullName + '\' has no expectations.'); + } + + if (result.status != 'disabled') { + specsExecuted++; + } + + if (!symbols){ + symbols = find('.jasmine-symbol-summary'); + } + + symbols.appendChild(createDom('li', { + className: noExpectations(result) ? 'jasmine-empty' : 'jasmine-' + result.status, + id: 'spec_' + result.id, + title: result.fullName + } + )); + + if (result.status == 'failed') { + failureCount++; + + var failure = + createDom('div', {className: 'jasmine-spec-detail jasmine-failed'}, + createDom('div', {className: 'jasmine-description'}, + createDom('a', {title: result.fullName, href: specHref(result)}, result.fullName) + ), + createDom('div', {className: 'jasmine-messages'}) + ); + var messages = failure.childNodes[1]; + + for (var i = 0; i < result.failedExpectations.length; i++) { + var expectation = result.failedExpectations[i]; + messages.appendChild(createDom('div', {className: 'jasmine-result-message'}, expectation.message)); + messages.appendChild(createDom('div', {className: 'jasmine-stack-trace'}, expectation.stack)); + } + + failures.push(failure); + } + + if (result.status == 'pending') { + pendingSpecCount++; + } + }; + + this.jasmineDone = function(doneResult) { + var banner = find('.jasmine-banner'); + var alert = find('.jasmine-alert'); + var order = doneResult && doneResult.order; + alert.appendChild(createDom('span', {className: 'jasmine-duration'}, 'finished in ' + timer.elapsed() / 1000 + 's')); + + banner.appendChild( + createDom('div', { className: 'jasmine-run-options' }, + createDom('span', { className: 'jasmine-trigger' }, 'Options'), + createDom('div', { className: 'jasmine-payload' }, + createDom('div', { className: 'jasmine-exceptions' }, + createDom('input', { + className: 'jasmine-raise', + id: 'jasmine-raise-exceptions', + type: 'checkbox' + }), + createDom('label', { className: 'jasmine-label', 'for': 'jasmine-raise-exceptions' }, 'raise exceptions')), + createDom('div', { className: 'jasmine-throw-failures' }, + createDom('input', { + className: 'jasmine-throw', + id: 'jasmine-throw-failures', + type: 'checkbox' + }), + createDom('label', { className: 'jasmine-label', 'for': 'jasmine-throw-failures' }, 'stop spec on expectation failure')), + createDom('div', { className: 'jasmine-random-order' }, + createDom('input', { + className: 'jasmine-random', + id: 'jasmine-random-order', + type: 'checkbox' + }), + createDom('label', { className: 'jasmine-label', 'for': 'jasmine-random-order' }, 'run tests in random order')) + ) + )); + + var raiseCheckbox = find('#jasmine-raise-exceptions'); + + raiseCheckbox.checked = !env.catchingExceptions(); + raiseCheckbox.onclick = onRaiseExceptionsClick; + + var throwCheckbox = find('#jasmine-throw-failures'); + throwCheckbox.checked = env.throwingExpectationFailures(); + throwCheckbox.onclick = onThrowExpectationsClick; + + var randomCheckbox = find('#jasmine-random-order'); + randomCheckbox.checked = env.randomTests(); + randomCheckbox.onclick = onRandomClick; + + var optionsMenu = find('.jasmine-run-options'), + optionsTrigger = optionsMenu.querySelector('.jasmine-trigger'), + optionsPayload = optionsMenu.querySelector('.jasmine-payload'), + isOpen = /\bjasmine-open\b/; + + optionsTrigger.onclick = function() { + if (isOpen.test(optionsPayload.className)) { + optionsPayload.className = optionsPayload.className.replace(isOpen, ''); + } else { + optionsPayload.className += ' jasmine-open'; + } + }; + + if (specsExecuted < totalSpecsDefined) { + var skippedMessage = 'Ran ' + specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all'; + alert.appendChild( + createDom('span', {className: 'jasmine-bar jasmine-skipped'}, + createDom('a', {href: '?', title: 'Run all specs'}, skippedMessage) + ) + ); + } + var statusBarMessage = ''; + var statusBarClassName = 'jasmine-bar '; + + if (totalSpecsDefined > 0) { + statusBarMessage += pluralize('spec', specsExecuted) + ', ' + pluralize('failure', failureCount); + if (pendingSpecCount) { statusBarMessage += ', ' + pluralize('pending spec', pendingSpecCount); } + statusBarClassName += (failureCount > 0) ? 'jasmine-failed' : 'jasmine-passed'; + } else { + statusBarClassName += 'jasmine-skipped'; + statusBarMessage += 'No specs found'; + } + + var seedBar; + if (order && order.random) { + seedBar = createDom('span', {className: 'jasmine-seed-bar'}, + ', randomized with seed ', + createDom('a', {title: 'randomized with seed ' + order.seed, href: seedHref(order.seed)}, order.seed) + ); + } + + alert.appendChild(createDom('span', {className: statusBarClassName}, statusBarMessage, seedBar)); + + for(i = 0; i < failedSuites.length; i++) { + var failedSuite = failedSuites[i]; + for(var j = 0; j < failedSuite.failedExpectations.length; j++) { + var errorBarMessage = 'AfterAll ' + failedSuite.failedExpectations[j].message; + var errorBarClassName = 'jasmine-bar jasmine-errored'; + alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessage)); + } + } + + var results = find('.jasmine-results'); + results.appendChild(summary); + + summaryList(topResults, summary); + + function summaryList(resultsTree, domParent) { + var specListNode; + for (var i = 0; i < resultsTree.children.length; i++) { + var resultNode = resultsTree.children[i]; + if (resultNode.type == 'suite') { + var suiteListNode = createDom('ul', {className: 'jasmine-suite', id: 'suite-' + resultNode.result.id}, + createDom('li', {className: 'jasmine-suite-detail'}, + createDom('a', {href: specHref(resultNode.result)}, resultNode.result.description) + ) + ); + + summaryList(resultNode, suiteListNode); + domParent.appendChild(suiteListNode); + } + if (resultNode.type == 'spec') { + if (domParent.getAttribute('class') != 'jasmine-specs') { + specListNode = createDom('ul', {className: 'jasmine-specs'}); + domParent.appendChild(specListNode); + } + var specDescription = resultNode.result.description; + if(noExpectations(resultNode.result)) { + specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription; + } + if(resultNode.result.status === 'pending' && resultNode.result.pendingReason !== '') { + specDescription = specDescription + ' PENDING WITH MESSAGE: ' + resultNode.result.pendingReason; + } + specListNode.appendChild( + createDom('li', { + className: 'jasmine-' + resultNode.result.status, + id: 'spec-' + resultNode.result.id + }, + createDom('a', {href: specHref(resultNode.result)}, specDescription) + ) + ); + } + } + } + + if (failures.length) { + alert.appendChild( + createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-spec-list'}, + createDom('span', {}, 'Spec List | '), + createDom('a', {className: 'jasmine-failures-menu', href: '#'}, 'Failures'))); + alert.appendChild( + createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-failure-list'}, + createDom('a', {className: 'jasmine-spec-list-menu', href: '#'}, 'Spec List'), + createDom('span', {}, ' | Failures '))); + + find('.jasmine-failures-menu').onclick = function() { + setMenuModeTo('jasmine-failure-list'); + }; + find('.jasmine-spec-list-menu').onclick = function() { + setMenuModeTo('jasmine-spec-list'); + }; + + setMenuModeTo('jasmine-failure-list'); + + var failureNode = find('.jasmine-failures'); + for (var i = 0; i < failures.length; i++) { + failureNode.appendChild(failures[i]); + } + } + }; + + return this; + + function find(selector) { + return getContainer().querySelector('.jasmine_html-reporter ' + selector); + } + + function clearPrior() { + // return the reporter + var oldReporter = find(''); + + if(oldReporter) { + getContainer().removeChild(oldReporter); + } + } + + function createDom(type, attrs, childrenVarArgs) { + var el = createElement(type); + + for (var i = 2; i < arguments.length; i++) { + var child = arguments[i]; + + if (typeof child === 'string') { + el.appendChild(createTextNode(child)); + } else { + if (child) { + el.appendChild(child); + } + } + } + + for (var attr in attrs) { + if (attr == 'className') { + el[attr] = attrs[attr]; + } else { + el.setAttribute(attr, attrs[attr]); + } + } + + return el; + } + + function pluralize(singular, count) { + var word = (count == 1 ? singular : singular + 's'); + + return '' + count + ' ' + word; + } + + function specHref(result) { + return addToExistingQueryString('spec', result.fullName); + } + + function seedHref(seed) { + return addToExistingQueryString('seed', seed); + } + + function defaultQueryString(key, value) { + return '?' + key + '=' + value; + } + + function setMenuModeTo(mode) { + htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode); + } + + function noExpectations(result) { + return (result.failedExpectations.length + result.passedExpectations.length) === 0 && + result.status === 'passed'; + } + } + + return HtmlReporter; +}; + +jasmineRequire.HtmlSpecFilter = function() { + function HtmlSpecFilter(options) { + var filterString = options && options.filterString() && options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + var filterPattern = new RegExp(filterString); + + this.matches = function(specName) { + return filterPattern.test(specName); + }; + } + + return HtmlSpecFilter; +}; + +jasmineRequire.ResultsNode = function() { + function ResultsNode(result, type, parent) { + this.result = result; + this.type = type; + this.parent = parent; + + this.children = []; + + this.addChild = function(result, type) { + this.children.push(new ResultsNode(result, type, this)); + }; + + this.last = function() { + return this.children[this.children.length - 1]; + }; + } + + return ResultsNode; +}; + +jasmineRequire.QueryString = function() { + function QueryString(options) { + + this.navigateWithNewParam = function(key, value) { + options.getWindowLocation().search = this.fullStringWithNewParam(key, value); + }; + + this.fullStringWithNewParam = function(key, value) { + var paramMap = queryStringToParamMap(); + paramMap[key] = value; + return toQueryString(paramMap); + }; + + this.getParam = function(key) { + return queryStringToParamMap()[key]; + }; + + return this; + + function toQueryString(paramMap) { + var qStrPairs = []; + for (var prop in paramMap) { + qStrPairs.push(encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop])); + } + return '?' + qStrPairs.join('&'); + } + + function queryStringToParamMap() { + var paramStr = options.getWindowLocation().search.substring(1), + params = [], + paramMap = {}; + + if (paramStr.length > 0) { + params = paramStr.split('&'); + for (var i = 0; i < params.length; i++) { + var p = params[i].split('='); + var value = decodeURIComponent(p[1]); + if (value === 'true' || value === 'false') { + value = JSON.parse(value); + } + paramMap[decodeURIComponent(p[0])] = value; + } + } + + return paramMap; + } + + } + + return QueryString; +}; diff --git a/tests/jasmine/lib/jasmine-2.4.1/jasmine.css b/tests/jasmine/lib/jasmine-2.4.1/jasmine.css new file mode 100644 index 0000000..6319982 --- /dev/null +++ b/tests/jasmine/lib/jasmine-2.4.1/jasmine.css @@ -0,0 +1,58 @@ +body { overflow-y: scroll; } + +.jasmine_html-reporter { background-color: #eee; padding: 5px; margin: -8px; font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333; } +.jasmine_html-reporter a { text-decoration: none; } +.jasmine_html-reporter a:hover { text-decoration: underline; } +.jasmine_html-reporter p, .jasmine_html-reporter h1, .jasmine_html-reporter h2, .jasmine_html-reporter h3, .jasmine_html-reporter h4, .jasmine_html-reporter h5, .jasmine_html-reporter h6 { margin: 0; line-height: 14px; } +.jasmine_html-reporter .jasmine-banner, .jasmine_html-reporter .jasmine-symbol-summary, .jasmine_html-reporter .jasmine-summary, .jasmine_html-reporter .jasmine-result-message, .jasmine_html-reporter .jasmine-spec .jasmine-description, .jasmine_html-reporter .jasmine-spec-detail .jasmine-description, .jasmine_html-reporter .jasmine-alert .jasmine-bar, .jasmine_html-reporter .jasmine-stack-trace { padding-left: 9px; padding-right: 9px; } +.jasmine_html-reporter .jasmine-banner { position: relative; } +.jasmine_html-reporter .jasmine-banner .jasmine-title { background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAAAZCAMAAACGusnyAAACdlBMVEX/////AP+AgICqVaqAQICZM5mAVYCSSZKAQICOOY6ATYCLRouAQICJO4mSSYCIRIiPQICHPIeOR4CGQ4aMQICGPYaLRoCFQ4W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cGF0aAogICAgICAgICAgICAgZD0iTSA2MDcuNDY1LDkwMy40NDUgNDk4Ljg1NSwxMDUyLjk3IDUyOS4zMiwxMDc1LjEgNjM3LjkzLDkyNS41NjYgNjA3LjQ2NSw5MDMuNDQ1IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoNTIiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjxwYXRoCiAgICAgICAgICAgICBkPSJtIDM4MC42ODgsNjIyLjEyOSAtMTEuNjI2LDM1LjgwMSAxNzUuNzU4LDU3LjA5IDExLjYyMSwtMzUuODAxIC0xNzUuNzUzLC01Ny4wOSIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDU0IgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0ibSA3MTYuMjg5LDM3Ni41OSAzNy42NDA2LDAgMCwxODQuODE2IC0zNy42NDA2LDAgMCwtMTg0LjgxNiB6IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoNTYiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=') no-repeat, none; -moz-background-size: 100%; -o-background-size: 100%; -webkit-background-size: 100%; background-size: 100%; display: block; float: left; width: 90px; height: 25px; } +.jasmine_html-reporter .jasmine-banner .jasmine-version { margin-left: 14px; position: relative; top: 6px; } +.jasmine_html-reporter #jasmine_content { position: fixed; right: 100%; } +.jasmine_html-reporter .jasmine-version { color: #aaa; } +.jasmine_html-reporter .jasmine-banner { margin-top: 14px; } +.jasmine_html-reporter .jasmine-duration { color: #fff; float: right; line-height: 28px; padding-right: 9px; } +.jasmine_html-reporter .jasmine-symbol-summary { overflow: hidden; *zoom: 1; margin: 14px 0; } +.jasmine_html-reporter .jasmine-symbol-summary li { display: inline-block; height: 10px; width: 14px; font-size: 16px; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-passed { font-size: 14px; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-passed:before { color: #007069; content: "\02022"; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-failed { line-height: 9px; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-failed:before { color: #ca3a11; content: "\d7"; font-weight: bold; margin-left: -1px; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-disabled { font-size: 14px; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-disabled:before { color: #bababa; content: "\02022"; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-pending { line-height: 17px; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-pending:before { color: #ba9d37; content: "*"; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-empty { font-size: 14px; } +.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-empty:before { color: #ba9d37; content: "\02022"; } +.jasmine_html-reporter .jasmine-run-options { float: right; margin-right: 5px; border: 1px solid #8a4182; color: #8a4182; position: relative; line-height: 20px; } +.jasmine_html-reporter .jasmine-run-options .jasmine-trigger { cursor: pointer; padding: 8px 16px; } +.jasmine_html-reporter .jasmine-run-options .jasmine-payload { position: absolute; display: none; right: -1px; border: 1px solid #8a4182; background-color: #eee; white-space: nowrap; padding: 4px 8px; } +.jasmine_html-reporter .jasmine-run-options .jasmine-payload.jasmine-open { display: block; } +.jasmine_html-reporter .jasmine-bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } +.jasmine_html-reporter .jasmine-bar.jasmine-failed { background-color: #ca3a11; } +.jasmine_html-reporter .jasmine-bar.jasmine-passed { background-color: #007069; } +.jasmine_html-reporter .jasmine-bar.jasmine-skipped { background-color: #bababa; } +.jasmine_html-reporter .jasmine-bar.jasmine-errored { background-color: #ca3a11; } +.jasmine_html-reporter .jasmine-bar.jasmine-menu { background-color: #fff; color: #aaa; } +.jasmine_html-reporter .jasmine-bar.jasmine-menu a { color: #333; } +.jasmine_html-reporter .jasmine-bar a { color: white; } +.jasmine_html-reporter.jasmine-spec-list .jasmine-bar.jasmine-menu.jasmine-failure-list, .jasmine_html-reporter.jasmine-spec-list .jasmine-results .jasmine-failures { display: none; } +.jasmine_html-reporter.jasmine-failure-list .jasmine-bar.jasmine-menu.jasmine-spec-list, .jasmine_html-reporter.jasmine-failure-list .jasmine-summary { display: none; } +.jasmine_html-reporter .jasmine-results { margin-top: 14px; } +.jasmine_html-reporter .jasmine-summary { margin-top: 14px; } +.jasmine_html-reporter .jasmine-summary ul { list-style-type: none; margin-left: 14px; padding-top: 0; padding-left: 0; } +.jasmine_html-reporter .jasmine-summary ul.jasmine-suite { margin-top: 7px; margin-bottom: 7px; } +.jasmine_html-reporter .jasmine-summary li.jasmine-passed a { color: #007069; } +.jasmine_html-reporter .jasmine-summary li.jasmine-failed a { color: #ca3a11; } +.jasmine_html-reporter .jasmine-summary li.jasmine-empty a { color: #ba9d37; } +.jasmine_html-reporter .jasmine-summary li.jasmine-pending a { color: #ba9d37; } +.jasmine_html-reporter .jasmine-summary li.jasmine-disabled a { color: #bababa; } +.jasmine_html-reporter .jasmine-description + .jasmine-suite { margin-top: 0; } +.jasmine_html-reporter .jasmine-suite { margin-top: 14px; } +.jasmine_html-reporter .jasmine-suite a { color: #333; } +.jasmine_html-reporter .jasmine-failures .jasmine-spec-detail { margin-bottom: 28px; } +.jasmine_html-reporter .jasmine-failures .jasmine-spec-detail .jasmine-description { background-color: #ca3a11; } +.jasmine_html-reporter .jasmine-failures .jasmine-spec-detail .jasmine-description a { color: white; } +.jasmine_html-reporter .jasmine-result-message { padding-top: 14px; color: #333; white-space: pre; } +.jasmine_html-reporter .jasmine-result-message span.jasmine-result { display: block; } +.jasmine_html-reporter .jasmine-stack-trace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666; border: 1px solid #ddd; background: white; white-space: pre; } diff --git a/tests/jasmine/lib/jasmine-2.4.1/jasmine.js b/tests/jasmine/lib/jasmine-2.4.1/jasmine.js new file mode 100644 index 0000000..bea469d --- /dev/null +++ b/tests/jasmine/lib/jasmine-2.4.1/jasmine.js @@ -0,0 +1,3454 @@ +/* +Copyright (c) 2008-2015 Pivotal Labs + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +var getJasmineRequireObj = (function (jasmineGlobal) { + var jasmineRequire; + + if (typeof module !== 'undefined' && module.exports) { + if (typeof global !== 'undefined') { + jasmineGlobal = global; + } else { + jasmineGlobal = {}; + } + jasmineRequire = exports; + } else { + if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') { + jasmineGlobal = window; + } + jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {}; + } + + function getJasmineRequire() { + return jasmineRequire; + } + + getJasmineRequire().core = function(jRequire) { + var j$ = {}; + + jRequire.base(j$, jasmineGlobal); + j$.util = jRequire.util(); + j$.errors = jRequire.errors(); + j$.Any = jRequire.Any(j$); + j$.Anything = jRequire.Anything(j$); + j$.CallTracker = jRequire.CallTracker(); + j$.MockDate = jRequire.MockDate(); + j$.Clock = jRequire.Clock(); + j$.DelayedFunctionScheduler = jRequire.DelayedFunctionScheduler(); + j$.Env = jRequire.Env(j$); + j$.ExceptionFormatter = jRequire.ExceptionFormatter(); + j$.Expectation = jRequire.Expectation(); + j$.buildExpectationResult = jRequire.buildExpectationResult(); + j$.JsApiReporter = jRequire.JsApiReporter(); + j$.matchersUtil = jRequire.matchersUtil(j$); + j$.ObjectContaining = jRequire.ObjectContaining(j$); + j$.ArrayContaining = jRequire.ArrayContaining(j$); + j$.pp = jRequire.pp(j$); + j$.QueueRunner = jRequire.QueueRunner(j$); + j$.ReportDispatcher = jRequire.ReportDispatcher(); + j$.Spec = jRequire.Spec(j$); + j$.SpyRegistry = jRequire.SpyRegistry(j$); + j$.SpyStrategy = jRequire.SpyStrategy(); + j$.StringMatching = jRequire.StringMatching(j$); + j$.Suite = jRequire.Suite(j$); + j$.Timer = jRequire.Timer(); + j$.TreeProcessor = jRequire.TreeProcessor(); + j$.version = jRequire.version(); + j$.Order = jRequire.Order(); + + j$.matchers = jRequire.requireMatchers(jRequire, j$); + + return j$; + }; + + return getJasmineRequire; +})(this); + +getJasmineRequireObj().requireMatchers = function(jRequire, j$) { + var availableMatchers = [ + 'toBe', + 'toBeCloseTo', + 'toBeDefined', + 'toBeFalsy', + 'toBeGreaterThan', + 'toBeLessThan', + 'toBeNaN', + 'toBeNull', + 'toBeTruthy', + 'toBeUndefined', + 'toContain', + 'toEqual', + 'toHaveBeenCalled', + 'toHaveBeenCalledWith', + 'toHaveBeenCalledTimes', + 'toMatch', + 'toThrow', + 'toThrowError' + ], + matchers = {}; + + for (var i = 0; i < availableMatchers.length; i++) { + var name = availableMatchers[i]; + matchers[name] = jRequire[name](j$); + } + + return matchers; +}; + +getJasmineRequireObj().base = function(j$, jasmineGlobal) { + j$.unimplementedMethod_ = function() { + throw new Error('unimplemented method'); + }; + + j$.MAX_PRETTY_PRINT_DEPTH = 40; + j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 100; + j$.DEFAULT_TIMEOUT_INTERVAL = 5000; + + j$.getGlobal = function() { + return jasmineGlobal; + }; + + j$.getEnv = function(options) { + var env = j$.currentEnv_ = j$.currentEnv_ || new j$.Env(options); + //jasmine. singletons in here (setTimeout blah blah). + return env; + }; + + j$.isArray_ = function(value) { + return j$.isA_('Array', value); + }; + + j$.isString_ = function(value) { + return j$.isA_('String', value); + }; + + j$.isNumber_ = function(value) { + return j$.isA_('Number', value); + }; + + j$.isA_ = function(typeName, value) { + return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; + }; + + j$.isDomNode = function(obj) { + return obj.nodeType > 0; + }; + + j$.fnNameFor = function(func) { + return func.name || func.toString().match(/^\s*function\s*(\w*)\s*\(/)[1]; + }; + + j$.any = function(clazz) { + return new j$.Any(clazz); + }; + + j$.anything = function() { + return new j$.Anything(); + }; + + j$.objectContaining = function(sample) { + return new j$.ObjectContaining(sample); + }; + + j$.stringMatching = function(expected) { + return new j$.StringMatching(expected); + }; + + j$.arrayContaining = function(sample) { + return new j$.ArrayContaining(sample); + }; + + j$.createSpy = function(name, originalFn) { + + var spyStrategy = new j$.SpyStrategy({ + name: name, + fn: originalFn, + getSpy: function() { return spy; } + }), + callTracker = new j$.CallTracker(), + spy = function() { + var callData = { + object: this, + args: Array.prototype.slice.apply(arguments) + }; + + callTracker.track(callData); + var returnValue = spyStrategy.exec.apply(this, arguments); + callData.returnValue = returnValue; + + return returnValue; + }; + + for (var prop in originalFn) { + if (prop === 'and' || prop === 'calls') { + throw new Error('Jasmine spies would overwrite the \'and\' and \'calls\' properties on the object being spied upon'); + } + + spy[prop] = originalFn[prop]; + } + + spy.and = spyStrategy; + spy.calls = callTracker; + + return spy; + }; + + j$.isSpy = function(putativeSpy) { + if (!putativeSpy) { + return false; + } + return putativeSpy.and instanceof j$.SpyStrategy && + putativeSpy.calls instanceof j$.CallTracker; + }; + + j$.createSpyObj = function(baseName, methodNames) { + if (j$.isArray_(baseName) && j$.util.isUndefined(methodNames)) { + methodNames = baseName; + baseName = 'unknown'; + } + + if (!j$.isArray_(methodNames) || methodNames.length === 0) { + throw 'createSpyObj requires a non-empty array of method names to create spies for'; + } + var obj = {}; + for (var i = 0; i < methodNames.length; i++) { + obj[methodNames[i]] = j$.createSpy(baseName + '.' + methodNames[i]); + } + return obj; + }; +}; + +getJasmineRequireObj().util = function() { + + var util = {}; + + util.inherit = function(childClass, parentClass) { + var Subclass = function() { + }; + Subclass.prototype = parentClass.prototype; + childClass.prototype = new Subclass(); + }; + + util.htmlEscape = function(str) { + if (!str) { + return str; + } + return str.replace(/&/g, '&') + .replace(//g, '>'); + }; + + util.argsToArray = function(args) { + var arrayOfArgs = []; + for (var i = 0; i < args.length; i++) { + arrayOfArgs.push(args[i]); + } + return arrayOfArgs; + }; + + util.isUndefined = function(obj) { + return obj === void 0; + }; + + util.arrayContains = function(array, search) { + var i = array.length; + while (i--) { + if (array[i] === search) { + return true; + } + } + return false; + }; + + util.clone = function(obj) { + if (Object.prototype.toString.apply(obj) === '[object Array]') { + return obj.slice(); + } + + var cloned = {}; + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { + cloned[prop] = obj[prop]; + } + } + + return cloned; + }; + + return util; +}; + +getJasmineRequireObj().Spec = function(j$) { + function Spec(attrs) { + this.expectationFactory = attrs.expectationFactory; + this.resultCallback = attrs.resultCallback || function() {}; + this.id = attrs.id; + this.description = attrs.description || ''; + this.queueableFn = attrs.queueableFn; + this.beforeAndAfterFns = attrs.beforeAndAfterFns || function() { return {befores: [], afters: []}; }; + this.userContext = attrs.userContext || function() { return {}; }; + this.onStart = attrs.onStart || function() {}; + this.getSpecName = attrs.getSpecName || function() { return ''; }; + this.expectationResultFactory = attrs.expectationResultFactory || function() { }; + this.queueRunnerFactory = attrs.queueRunnerFactory || function() {}; + this.catchingExceptions = attrs.catchingExceptions || function() { return true; }; + this.throwOnExpectationFailure = !!attrs.throwOnExpectationFailure; + + if (!this.queueableFn.fn) { + this.pend(); + } + + this.result = { + id: this.id, + description: this.description, + fullName: this.getFullName(), + failedExpectations: [], + passedExpectations: [], + pendingReason: '' + }; + } + + Spec.prototype.addExpectationResult = function(passed, data, isError) { + var expectationResult = this.expectationResultFactory(data); + if (passed) { + this.result.passedExpectations.push(expectationResult); + } else { + this.result.failedExpectations.push(expectationResult); + + if (this.throwOnExpectationFailure && !isError) { + throw new j$.errors.ExpectationFailed(); + } + } + }; + + Spec.prototype.expect = function(actual) { + return this.expectationFactory(actual, this); + }; + + Spec.prototype.execute = function(onComplete, enabled) { + var self = this; + + this.onStart(this); + + if (!this.isExecutable() || this.markedPending || enabled === false) { + complete(enabled); + return; + } + + var fns = this.beforeAndAfterFns(); + var allFns = fns.befores.concat(this.queueableFn).concat(fns.afters); + + this.queueRunnerFactory({ + queueableFns: allFns, + onException: function() { self.onException.apply(self, arguments); }, + onComplete: complete, + userContext: this.userContext() + }); + + function complete(enabledAgain) { + self.result.status = self.status(enabledAgain); + self.resultCallback(self.result); + + if (onComplete) { + onComplete(); + } + } + }; + + Spec.prototype.onException = function onException(e) { + if (Spec.isPendingSpecException(e)) { + this.pend(extractCustomPendingMessage(e)); + return; + } + + if (e instanceof j$.errors.ExpectationFailed) { + return; + } + + this.addExpectationResult(false, { + matcherName: '', + passed: false, + expected: '', + actual: '', + error: e + }, true); + }; + + Spec.prototype.disable = function() { + this.disabled = true; + }; + + Spec.prototype.pend = function(message) { + this.markedPending = true; + if (message) { + this.result.pendingReason = message; + } + }; + + Spec.prototype.getResult = function() { + this.result.status = this.status(); + return this.result; + }; + + Spec.prototype.status = function(enabled) { + if (this.disabled || enabled === false) { + return 'disabled'; + } + + if (this.markedPending) { + return 'pending'; + } + + if (this.result.failedExpectations.length > 0) { + return 'failed'; + } else { + return 'passed'; + } + }; + + Spec.prototype.isExecutable = function() { + return !this.disabled; + }; + + Spec.prototype.getFullName = function() { + return this.getSpecName(this); + }; + + var extractCustomPendingMessage = function(e) { + var fullMessage = e.toString(), + boilerplateStart = fullMessage.indexOf(Spec.pendingSpecExceptionMessage), + boilerplateEnd = boilerplateStart + Spec.pendingSpecExceptionMessage.length; + + return fullMessage.substr(boilerplateEnd); + }; + + Spec.pendingSpecExceptionMessage = '=> marked Pending'; + + Spec.isPendingSpecException = function(e) { + return !!(e && e.toString && e.toString().indexOf(Spec.pendingSpecExceptionMessage) !== -1); + }; + + return Spec; +}; + +if (typeof window == void 0 && typeof exports == 'object') { + exports.Spec = jasmineRequire.Spec; +} + +/*jshint bitwise: false*/ + +getJasmineRequireObj().Order = function() { + function Order(options) { + this.random = 'random' in options ? options.random : true; + var seed = this.seed = options.seed || generateSeed(); + this.sort = this.random ? randomOrder : naturalOrder; + + function naturalOrder(items) { + return items; + } + + function randomOrder(items) { + var copy = items.slice(); + copy.sort(function(a, b) { + return jenkinsHash(seed + a.id) - jenkinsHash(seed + b.id); + }); + return copy; + } + + function generateSeed() { + return String(Math.random()).slice(-5); + } + + // Bob Jenkins One-at-a-Time Hash algorithm is a non-cryptographic hash function + // used to get a different output when the key changes slighly. + // We use your return to sort the children randomly in a consistent way when + // used in conjunction with a seed + + function jenkinsHash(key) { + var hash, i; + for(hash = i = 0; i < key.length; ++i) { + hash += key.charCodeAt(i); + hash += (hash << 10); + hash ^= (hash >> 6); + } + hash += (hash << 3); + hash ^= (hash >> 11); + hash += (hash << 15); + return hash; + } + + } + + return Order; +}; + +getJasmineRequireObj().Env = function(j$) { + function Env(options) { + options = options || {}; + + var self = this; + var global = options.global || j$.getGlobal(); + + var totalSpecsDefined = 0; + + var catchExceptions = true; + + var realSetTimeout = j$.getGlobal().setTimeout; + var realClearTimeout = j$.getGlobal().clearTimeout; + this.clock = new j$.Clock(global, function () { return new j$.DelayedFunctionScheduler(); }, new j$.MockDate(global)); + + var runnableLookupTable = {}; + var runnableResources = {}; + + var currentSpec = null; + var currentlyExecutingSuites = []; + var currentDeclarationSuite = null; + var throwOnExpectationFailure = false; + var random = false; + var seed = null; + + var currentSuite = function() { + return currentlyExecutingSuites[currentlyExecutingSuites.length - 1]; + }; + + var currentRunnable = function() { + return currentSpec || currentSuite(); + }; + + var reporter = new j$.ReportDispatcher([ + 'jasmineStarted', + 'jasmineDone', + 'suiteStarted', + 'suiteDone', + 'specStarted', + 'specDone' + ]); + + this.specFilter = function() { + return true; + }; + + this.addCustomEqualityTester = function(tester) { + if(!currentRunnable()) { + throw new Error('Custom Equalities must be added in a before function or a spec'); + } + runnableResources[currentRunnable().id].customEqualityTesters.push(tester); + }; + + this.addMatchers = function(matchersToAdd) { + if(!currentRunnable()) { + throw new Error('Matchers must be added in a before function or a spec'); + } + var customMatchers = runnableResources[currentRunnable().id].customMatchers; + for (var matcherName in matchersToAdd) { + customMatchers[matcherName] = matchersToAdd[matcherName]; + } + }; + + j$.Expectation.addCoreMatchers(j$.matchers); + + var nextSpecId = 0; + var getNextSpecId = function() { + return 'spec' + nextSpecId++; + }; + + var nextSuiteId = 0; + var getNextSuiteId = function() { + return 'suite' + nextSuiteId++; + }; + + var expectationFactory = function(actual, spec) { + return j$.Expectation.Factory({ + util: j$.matchersUtil, + customEqualityTesters: runnableResources[spec.id].customEqualityTesters, + customMatchers: runnableResources[spec.id].customMatchers, + actual: actual, + addExpectationResult: addExpectationResult + }); + + function addExpectationResult(passed, result) { + return spec.addExpectationResult(passed, result); + } + }; + + var defaultResourcesForRunnable = function(id, parentRunnableId) { + var resources = {spies: [], customEqualityTesters: [], customMatchers: {}}; + + if(runnableResources[parentRunnableId]){ + resources.customEqualityTesters = j$.util.clone(runnableResources[parentRunnableId].customEqualityTesters); + resources.customMatchers = j$.util.clone(runnableResources[parentRunnableId].customMatchers); + } + + runnableResources[id] = resources; + }; + + var clearResourcesForRunnable = function(id) { + spyRegistry.clearSpies(); + delete runnableResources[id]; + }; + + var beforeAndAfterFns = function(suite) { + return function() { + var befores = [], + afters = []; + + while(suite) { + befores = befores.concat(suite.beforeFns); + afters = afters.concat(suite.afterFns); + + suite = suite.parentSuite; + } + + return { + befores: befores.reverse(), + afters: afters + }; + }; + }; + + var getSpecName = function(spec, suite) { + return suite.getFullName() + ' ' + spec.description; + }; + + // TODO: we may just be able to pass in the fn instead of wrapping here + var buildExpectationResult = j$.buildExpectationResult, + exceptionFormatter = new j$.ExceptionFormatter(), + expectationResultFactory = function(attrs) { + attrs.messageFormatter = exceptionFormatter.message; + attrs.stackFormatter = exceptionFormatter.stack; + + return buildExpectationResult(attrs); + }; + + // TODO: fix this naming, and here's where the value comes in + this.catchExceptions = function(value) { + catchExceptions = !!value; + return catchExceptions; + }; + + this.catchingExceptions = function() { + return catchExceptions; + }; + + var maximumSpecCallbackDepth = 20; + var currentSpecCallbackDepth = 0; + + function clearStack(fn) { + currentSpecCallbackDepth++; + if (currentSpecCallbackDepth >= maximumSpecCallbackDepth) { + currentSpecCallbackDepth = 0; + realSetTimeout(fn, 0); + } else { + fn(); + } + } + + var catchException = function(e) { + return j$.Spec.isPendingSpecException(e) || catchExceptions; + }; + + this.throwOnExpectationFailure = function(value) { + throwOnExpectationFailure = !!value; + }; + + this.throwingExpectationFailures = function() { + return throwOnExpectationFailure; + }; + + this.randomizeTests = function(value) { + random = !!value; + }; + + this.randomTests = function() { + return random; + }; + + this.seed = function(value) { + if (value) { + seed = value; + } + return seed; + }; + + var queueRunnerFactory = function(options) { + options.catchException = catchException; + options.clearStack = options.clearStack || clearStack; + options.timeout = {setTimeout: realSetTimeout, clearTimeout: realClearTimeout}; + options.fail = self.fail; + + new j$.QueueRunner(options).execute(); + }; + + var topSuite = new j$.Suite({ + env: this, + id: getNextSuiteId(), + description: 'Jasmine__TopLevel__Suite', + queueRunner: queueRunnerFactory + }); + runnableLookupTable[topSuite.id] = topSuite; + defaultResourcesForRunnable(topSuite.id); + currentDeclarationSuite = topSuite; + + this.topSuite = function() { + return topSuite; + }; + + this.execute = function(runnablesToRun) { + if(!runnablesToRun) { + if (focusedRunnables.length) { + runnablesToRun = focusedRunnables; + } else { + runnablesToRun = [topSuite.id]; + } + } + + var order = new j$.Order({ + random: random, + seed: seed + }); + + var processor = new j$.TreeProcessor({ + tree: topSuite, + runnableIds: runnablesToRun, + queueRunnerFactory: queueRunnerFactory, + nodeStart: function(suite) { + currentlyExecutingSuites.push(suite); + defaultResourcesForRunnable(suite.id, suite.parentSuite.id); + reporter.suiteStarted(suite.result); + }, + nodeComplete: function(suite, result) { + if (!suite.disabled) { + clearResourcesForRunnable(suite.id); + } + currentlyExecutingSuites.pop(); + reporter.suiteDone(result); + }, + orderChildren: function(node) { + return order.sort(node.children); + } + }); + + if(!processor.processTree().valid) { + throw new Error('Invalid order: would cause a beforeAll or afterAll to be run multiple times'); + } + + reporter.jasmineStarted({ + totalSpecsDefined: totalSpecsDefined + }); + + processor.execute(function() { + reporter.jasmineDone({ + order: order + }); + }); + }; + + this.addReporter = function(reporterToAdd) { + reporter.addReporter(reporterToAdd); + }; + + var spyRegistry = new j$.SpyRegistry({currentSpies: function() { + if(!currentRunnable()) { + throw new Error('Spies must be created in a before function or a spec'); + } + return runnableResources[currentRunnable().id].spies; + }}); + + this.spyOn = function() { + return spyRegistry.spyOn.apply(spyRegistry, arguments); + }; + + var suiteFactory = function(description) { + var suite = new j$.Suite({ + env: self, + id: getNextSuiteId(), + description: description, + parentSuite: currentDeclarationSuite, + expectationFactory: expectationFactory, + expectationResultFactory: expectationResultFactory, + throwOnExpectationFailure: throwOnExpectationFailure + }); + + runnableLookupTable[suite.id] = suite; + return suite; + }; + + this.describe = function(description, specDefinitions) { + var suite = suiteFactory(description); + if (specDefinitions.length > 0) { + throw new Error('describe does not expect a done parameter'); + } + if (currentDeclarationSuite.markedPending) { + suite.pend(); + } + addSpecsToSuite(suite, specDefinitions); + return suite; + }; + + this.xdescribe = function(description, specDefinitions) { + var suite = suiteFactory(description); + suite.pend(); + addSpecsToSuite(suite, specDefinitions); + return suite; + }; + + var focusedRunnables = []; + + this.fdescribe = function(description, specDefinitions) { + var suite = suiteFactory(description); + suite.isFocused = true; + + focusedRunnables.push(suite.id); + unfocusAncestor(); + addSpecsToSuite(suite, specDefinitions); + + return suite; + }; + + function addSpecsToSuite(suite, specDefinitions) { + var parentSuite = currentDeclarationSuite; + parentSuite.addChild(suite); + currentDeclarationSuite = suite; + + var declarationError = null; + try { + specDefinitions.call(suite); + } catch (e) { + declarationError = e; + } + + if (declarationError) { + self.it('encountered a declaration exception', function() { + throw declarationError; + }); + } + + currentDeclarationSuite = parentSuite; + } + + function findFocusedAncestor(suite) { + while (suite) { + if (suite.isFocused) { + return suite.id; + } + suite = suite.parentSuite; + } + + return null; + } + + function unfocusAncestor() { + var focusedAncestor = findFocusedAncestor(currentDeclarationSuite); + if (focusedAncestor) { + for (var i = 0; i < focusedRunnables.length; i++) { + if (focusedRunnables[i] === focusedAncestor) { + focusedRunnables.splice(i, 1); + break; + } + } + } + } + + var specFactory = function(description, fn, suite, timeout) { + totalSpecsDefined++; + var spec = new j$.Spec({ + id: getNextSpecId(), + beforeAndAfterFns: beforeAndAfterFns(suite), + expectationFactory: expectationFactory, + resultCallback: specResultCallback, + getSpecName: function(spec) { + return getSpecName(spec, suite); + }, + onStart: specStarted, + description: description, + expectationResultFactory: expectationResultFactory, + queueRunnerFactory: queueRunnerFactory, + userContext: function() { return suite.clonedSharedUserContext(); }, + queueableFn: { + fn: fn, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }, + throwOnExpectationFailure: throwOnExpectationFailure + }); + + runnableLookupTable[spec.id] = spec; + + if (!self.specFilter(spec)) { + spec.disable(); + } + + return spec; + + function specResultCallback(result) { + clearResourcesForRunnable(spec.id); + currentSpec = null; + reporter.specDone(result); + } + + function specStarted(spec) { + currentSpec = spec; + defaultResourcesForRunnable(spec.id, suite.id); + reporter.specStarted(spec.result); + } + }; + + this.it = function(description, fn, timeout) { + var spec = specFactory(description, fn, currentDeclarationSuite, timeout); + if (currentDeclarationSuite.markedPending) { + spec.pend(); + } + currentDeclarationSuite.addChild(spec); + return spec; + }; + + this.xit = function() { + var spec = this.it.apply(this, arguments); + spec.pend('Temporarily disabled with xit'); + return spec; + }; + + this.fit = function(description, fn, timeout){ + var spec = specFactory(description, fn, currentDeclarationSuite, timeout); + currentDeclarationSuite.addChild(spec); + focusedRunnables.push(spec.id); + unfocusAncestor(); + return spec; + }; + + this.expect = function(actual) { + if (!currentRunnable()) { + throw new Error('\'expect\' was used when there was no current spec, this could be because an asynchronous test timed out'); + } + + return currentRunnable().expect(actual); + }; + + this.beforeEach = function(beforeEachFunction, timeout) { + currentDeclarationSuite.beforeEach({ + fn: beforeEachFunction, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }); + }; + + this.beforeAll = function(beforeAllFunction, timeout) { + currentDeclarationSuite.beforeAll({ + fn: beforeAllFunction, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }); + }; + + this.afterEach = function(afterEachFunction, timeout) { + currentDeclarationSuite.afterEach({ + fn: afterEachFunction, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }); + }; + + this.afterAll = function(afterAllFunction, timeout) { + currentDeclarationSuite.afterAll({ + fn: afterAllFunction, + timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; } + }); + }; + + this.pending = function(message) { + var fullMessage = j$.Spec.pendingSpecExceptionMessage; + if(message) { + fullMessage += message; + } + throw fullMessage; + }; + + this.fail = function(error) { + var message = 'Failed'; + if (error) { + message += ': '; + message += error.message || error; + } + + currentRunnable().addExpectationResult(false, { + matcherName: '', + passed: false, + expected: '', + actual: '', + message: message, + error: error && error.message ? error : null + }); + }; + } + + return Env; +}; + +getJasmineRequireObj().JsApiReporter = function() { + + var noopTimer = { + start: function(){}, + elapsed: function(){ return 0; } + }; + + function JsApiReporter(options) { + var timer = options.timer || noopTimer, + status = 'loaded'; + + this.started = false; + this.finished = false; + this.runDetails = {}; + + this.jasmineStarted = function() { + this.started = true; + status = 'started'; + timer.start(); + }; + + var executionTime; + + this.jasmineDone = function(runDetails) { + this.finished = true; + this.runDetails = runDetails; + executionTime = timer.elapsed(); + status = 'done'; + }; + + this.status = function() { + return status; + }; + + var suites = [], + suites_hash = {}; + + this.suiteStarted = function(result) { + suites_hash[result.id] = result; + }; + + this.suiteDone = function(result) { + storeSuite(result); + }; + + this.suiteResults = function(index, length) { + return suites.slice(index, index + length); + }; + + function storeSuite(result) { + suites.push(result); + suites_hash[result.id] = result; + } + + this.suites = function() { + return suites_hash; + }; + + var specs = []; + + this.specDone = function(result) { + specs.push(result); + }; + + this.specResults = function(index, length) { + return specs.slice(index, index + length); + }; + + this.specs = function() { + return specs; + }; + + this.executionTime = function() { + return executionTime; + }; + + } + + return JsApiReporter; +}; + +getJasmineRequireObj().CallTracker = function() { + + function CallTracker() { + var calls = []; + + this.track = function(context) { + calls.push(context); + }; + + this.any = function() { + return !!calls.length; + }; + + this.count = function() { + return calls.length; + }; + + this.argsFor = function(index) { + var call = calls[index]; + return call ? call.args : []; + }; + + this.all = function() { + return calls; + }; + + this.allArgs = function() { + var callArgs = []; + for(var i = 0; i < calls.length; i++){ + callArgs.push(calls[i].args); + } + + return callArgs; + }; + + this.first = function() { + return calls[0]; + }; + + this.mostRecent = function() { + return calls[calls.length - 1]; + }; + + this.reset = function() { + calls = []; + }; + } + + return CallTracker; +}; + +getJasmineRequireObj().Clock = function() { + function Clock(global, delayedFunctionSchedulerFactory, mockDate) { + var self = this, + realTimingFunctions = { + setTimeout: global.setTimeout, + clearTimeout: global.clearTimeout, + setInterval: global.setInterval, + clearInterval: global.clearInterval + }, + fakeTimingFunctions = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, + clearInterval: clearInterval + }, + installed = false, + delayedFunctionScheduler, + timer; + + + self.install = function() { + if(!originalTimingFunctionsIntact()) { + throw new Error('Jasmine Clock was unable to install over custom global timer functions. Is the clock already installed?'); + } + replace(global, fakeTimingFunctions); + timer = fakeTimingFunctions; + delayedFunctionScheduler = delayedFunctionSchedulerFactory(); + installed = true; + + return self; + }; + + self.uninstall = function() { + delayedFunctionScheduler = null; + mockDate.uninstall(); + replace(global, realTimingFunctions); + + timer = realTimingFunctions; + installed = false; + }; + + self.withMock = function(closure) { + this.install(); + try { + closure(); + } finally { + this.uninstall(); + } + }; + + self.mockDate = function(initialDate) { + mockDate.install(initialDate); + }; + + self.setTimeout = function(fn, delay, params) { + if (legacyIE()) { + if (arguments.length > 2) { + throw new Error('IE < 9 cannot support extra params to setTimeout without a polyfill'); + } + return timer.setTimeout(fn, delay); + } + return Function.prototype.apply.apply(timer.setTimeout, [global, arguments]); + }; + + self.setInterval = function(fn, delay, params) { + if (legacyIE()) { + if (arguments.length > 2) { + throw new Error('IE < 9 cannot support extra params to setInterval without a polyfill'); + } + return timer.setInterval(fn, delay); + } + return Function.prototype.apply.apply(timer.setInterval, [global, arguments]); + }; + + self.clearTimeout = function(id) { + return Function.prototype.call.apply(timer.clearTimeout, [global, id]); + }; + + self.clearInterval = function(id) { + return Function.prototype.call.apply(timer.clearInterval, [global, id]); + }; + + self.tick = function(millis) { + if (installed) { + mockDate.tick(millis); + delayedFunctionScheduler.tick(millis); + } else { + throw new Error('Mock clock is not installed, use jasmine.clock().install()'); + } + }; + + return self; + + function originalTimingFunctionsIntact() { + return global.setTimeout === realTimingFunctions.setTimeout && + global.clearTimeout === realTimingFunctions.clearTimeout && + global.setInterval === realTimingFunctions.setInterval && + global.clearInterval === realTimingFunctions.clearInterval; + } + + function legacyIE() { + //if these methods are polyfilled, apply will be present + return !(realTimingFunctions.setTimeout || realTimingFunctions.setInterval).apply; + } + + function replace(dest, source) { + for (var prop in source) { + dest[prop] = source[prop]; + } + } + + function setTimeout(fn, delay) { + return delayedFunctionScheduler.scheduleFunction(fn, delay, argSlice(arguments, 2)); + } + + function clearTimeout(id) { + return delayedFunctionScheduler.removeFunctionWithId(id); + } + + function setInterval(fn, interval) { + return delayedFunctionScheduler.scheduleFunction(fn, interval, argSlice(arguments, 2), true); + } + + function clearInterval(id) { + return delayedFunctionScheduler.removeFunctionWithId(id); + } + + function argSlice(argsObj, n) { + return Array.prototype.slice.call(argsObj, n); + } + } + + return Clock; +}; + +getJasmineRequireObj().DelayedFunctionScheduler = function() { + function DelayedFunctionScheduler() { + var self = this; + var scheduledLookup = []; + var scheduledFunctions = {}; + var currentTime = 0; + var delayedFnCount = 0; + + self.tick = function(millis) { + millis = millis || 0; + var endTime = currentTime + millis; + + runScheduledFunctions(endTime); + currentTime = endTime; + }; + + self.scheduleFunction = function(funcToCall, millis, params, recurring, timeoutKey, runAtMillis) { + var f; + if (typeof(funcToCall) === 'string') { + /* jshint evil: true */ + f = function() { return eval(funcToCall); }; + /* jshint evil: false */ + } else { + f = funcToCall; + } + + millis = millis || 0; + timeoutKey = timeoutKey || ++delayedFnCount; + runAtMillis = runAtMillis || (currentTime + millis); + + var funcToSchedule = { + runAtMillis: runAtMillis, + funcToCall: f, + recurring: recurring, + params: params, + timeoutKey: timeoutKey, + millis: millis + }; + + if (runAtMillis in scheduledFunctions) { + scheduledFunctions[runAtMillis].push(funcToSchedule); + } else { + scheduledFunctions[runAtMillis] = [funcToSchedule]; + scheduledLookup.push(runAtMillis); + scheduledLookup.sort(function (a, b) { + return a - b; + }); + } + + return timeoutKey; + }; + + self.removeFunctionWithId = function(timeoutKey) { + for (var runAtMillis in scheduledFunctions) { + var funcs = scheduledFunctions[runAtMillis]; + var i = indexOfFirstToPass(funcs, function (func) { + return func.timeoutKey === timeoutKey; + }); + + if (i > -1) { + if (funcs.length === 1) { + delete scheduledFunctions[runAtMillis]; + deleteFromLookup(runAtMillis); + } else { + funcs.splice(i, 1); + } + + // intervals get rescheduled when executed, so there's never more + // than a single scheduled function with a given timeoutKey + break; + } + } + }; + + return self; + + function indexOfFirstToPass(array, testFn) { + var index = -1; + + for (var i = 0; i < array.length; ++i) { + if (testFn(array[i])) { + index = i; + break; + } + } + + return index; + } + + function deleteFromLookup(key) { + var value = Number(key); + var i = indexOfFirstToPass(scheduledLookup, function (millis) { + return millis === value; + }); + + if (i > -1) { + scheduledLookup.splice(i, 1); + } + } + + function reschedule(scheduledFn) { + self.scheduleFunction(scheduledFn.funcToCall, + scheduledFn.millis, + scheduledFn.params, + true, + scheduledFn.timeoutKey, + scheduledFn.runAtMillis + scheduledFn.millis); + } + + function forEachFunction(funcsToRun, callback) { + for (var i = 0; i < funcsToRun.length; ++i) { + callback(funcsToRun[i]); + } + } + + function runScheduledFunctions(endTime) { + if (scheduledLookup.length === 0 || scheduledLookup[0] > endTime) { + return; + } + + do { + currentTime = scheduledLookup.shift(); + + var funcsToRun = scheduledFunctions[currentTime]; + delete scheduledFunctions[currentTime]; + + forEachFunction(funcsToRun, function(funcToRun) { + if (funcToRun.recurring) { + reschedule(funcToRun); + } + }); + + forEachFunction(funcsToRun, function(funcToRun) { + funcToRun.funcToCall.apply(null, funcToRun.params || []); + }); + } while (scheduledLookup.length > 0 && + // checking first if we're out of time prevents setTimeout(0) + // scheduled in a funcToRun from forcing an extra iteration + currentTime !== endTime && + scheduledLookup[0] <= endTime); + } + } + + return DelayedFunctionScheduler; +}; + +getJasmineRequireObj().ExceptionFormatter = function() { + function ExceptionFormatter() { + this.message = function(error) { + var message = ''; + + if (error.name && error.message) { + message += error.name + ': ' + error.message; + } else { + message += error.toString() + ' thrown'; + } + + if (error.fileName || error.sourceURL) { + message += ' in ' + (error.fileName || error.sourceURL); + } + + if (error.line || error.lineNumber) { + message += ' (line ' + (error.line || error.lineNumber) + ')'; + } + + return message; + }; + + this.stack = function(error) { + return error ? error.stack : null; + }; + } + + return ExceptionFormatter; +}; + +getJasmineRequireObj().Expectation = function() { + + function Expectation(options) { + this.util = options.util || { buildFailureMessage: function() {} }; + this.customEqualityTesters = options.customEqualityTesters || []; + this.actual = options.actual; + this.addExpectationResult = options.addExpectationResult || function(){}; + this.isNot = options.isNot; + + var customMatchers = options.customMatchers || {}; + for (var matcherName in customMatchers) { + this[matcherName] = Expectation.prototype.wrapCompare(matcherName, customMatchers[matcherName]); + } + } + + Expectation.prototype.wrapCompare = function(name, matcherFactory) { + return function() { + var args = Array.prototype.slice.call(arguments, 0), + expected = args.slice(0), + message = ''; + + args.unshift(this.actual); + + var matcher = matcherFactory(this.util, this.customEqualityTesters), + matcherCompare = matcher.compare; + + function defaultNegativeCompare() { + var result = matcher.compare.apply(null, args); + result.pass = !result.pass; + return result; + } + + if (this.isNot) { + matcherCompare = matcher.negativeCompare || defaultNegativeCompare; + } + + var result = matcherCompare.apply(null, args); + + if (!result.pass) { + if (!result.message) { + args.unshift(this.isNot); + args.unshift(name); + message = this.util.buildFailureMessage.apply(null, args); + } else { + if (Object.prototype.toString.apply(result.message) === '[object Function]') { + message = result.message(); + } else { + message = result.message; + } + } + } + + if (expected.length == 1) { + expected = expected[0]; + } + + // TODO: how many of these params are needed? + this.addExpectationResult( + result.pass, + { + matcherName: name, + passed: result.pass, + message: message, + actual: this.actual, + expected: expected // TODO: this may need to be arrayified/sliced + } + ); + }; + }; + + Expectation.addCoreMatchers = function(matchers) { + var prototype = Expectation.prototype; + for (var matcherName in matchers) { + var matcher = matchers[matcherName]; + prototype[matcherName] = prototype.wrapCompare(matcherName, matcher); + } + }; + + Expectation.Factory = function(options) { + options = options || {}; + + var expect = new Expectation(options); + + // TODO: this would be nice as its own Object - NegativeExpectation + // TODO: copy instead of mutate options + options.isNot = true; + expect.not = new Expectation(options); + + return expect; + }; + + return Expectation; +}; + +//TODO: expectation result may make more sense as a presentation of an expectation. +getJasmineRequireObj().buildExpectationResult = function() { + function buildExpectationResult(options) { + var messageFormatter = options.messageFormatter || function() {}, + stackFormatter = options.stackFormatter || function() {}; + + var result = { + matcherName: options.matcherName, + message: message(), + stack: stack(), + passed: options.passed + }; + + if(!result.passed) { + result.expected = options.expected; + result.actual = options.actual; + } + + return result; + + function message() { + if (options.passed) { + return 'Passed.'; + } else if (options.message) { + return options.message; + } else if (options.error) { + return messageFormatter(options.error); + } + return ''; + } + + function stack() { + if (options.passed) { + return ''; + } + + var error = options.error; + if (!error) { + try { + throw new Error(message()); + } catch (e) { + error = e; + } + } + return stackFormatter(error); + } + } + + return buildExpectationResult; +}; + +getJasmineRequireObj().MockDate = function() { + function MockDate(global) { + var self = this; + var currentTime = 0; + + if (!global || !global.Date) { + self.install = function() {}; + self.tick = function() {}; + self.uninstall = function() {}; + return self; + } + + var GlobalDate = global.Date; + + self.install = function(mockDate) { + if (mockDate instanceof GlobalDate) { + currentTime = mockDate.getTime(); + } else { + currentTime = new GlobalDate().getTime(); + } + + global.Date = FakeDate; + }; + + self.tick = function(millis) { + millis = millis || 0; + currentTime = currentTime + millis; + }; + + self.uninstall = function() { + currentTime = 0; + global.Date = GlobalDate; + }; + + createDateProperties(); + + return self; + + function FakeDate() { + switch(arguments.length) { + case 0: + return new GlobalDate(currentTime); + case 1: + return new GlobalDate(arguments[0]); + case 2: + return new GlobalDate(arguments[0], arguments[1]); + case 3: + return new GlobalDate(arguments[0], arguments[1], arguments[2]); + case 4: + return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3]); + case 5: + return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], + arguments[4]); + case 6: + return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], + arguments[4], arguments[5]); + default: + return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], + arguments[4], arguments[5], arguments[6]); + } + } + + function createDateProperties() { + FakeDate.prototype = GlobalDate.prototype; + + FakeDate.now = function() { + if (GlobalDate.now) { + return currentTime; + } else { + throw new Error('Browser does not support Date.now()'); + } + }; + + FakeDate.toSource = GlobalDate.toSource; + FakeDate.toString = GlobalDate.toString; + FakeDate.parse = GlobalDate.parse; + FakeDate.UTC = GlobalDate.UTC; + } + } + + return MockDate; +}; + +getJasmineRequireObj().pp = function(j$) { + + function PrettyPrinter() { + this.ppNestLevel_ = 0; + this.seen = []; + } + + PrettyPrinter.prototype.format = function(value) { + this.ppNestLevel_++; + try { + if (j$.util.isUndefined(value)) { + this.emitScalar('undefined'); + } else if (value === null) { + this.emitScalar('null'); + } else if (value === 0 && 1/value === -Infinity) { + this.emitScalar('-0'); + } else if (value === j$.getGlobal()) { + this.emitScalar(''); + } else if (value.jasmineToString) { + this.emitScalar(value.jasmineToString()); + } else if (typeof value === 'string') { + this.emitString(value); + } else if (j$.isSpy(value)) { + this.emitScalar('spy on ' + value.and.identity()); + } else if (value instanceof RegExp) { + this.emitScalar(value.toString()); + } else if (typeof value === 'function') { + this.emitScalar('Function'); + } else if (typeof value.nodeType === 'number') { + this.emitScalar('HTMLNode'); + } else if (value instanceof Date) { + this.emitScalar('Date(' + value + ')'); + } else if (value.toString && typeof value === 'object' && !(value instanceof Array) && value.toString !== Object.prototype.toString) { + this.emitScalar(value.toString()); + } else if (j$.util.arrayContains(this.seen, value)) { + this.emitScalar(''); + } else if (j$.isArray_(value) || j$.isA_('Object', value)) { + this.seen.push(value); + if (j$.isArray_(value)) { + this.emitArray(value); + } else { + this.emitObject(value); + } + this.seen.pop(); + } else { + this.emitScalar(value.toString()); + } + } finally { + this.ppNestLevel_--; + } + }; + + PrettyPrinter.prototype.iterateObject = function(obj, fn) { + for (var property in obj) { + if (!Object.prototype.hasOwnProperty.call(obj, property)) { continue; } + fn(property, obj.__lookupGetter__ ? (!j$.util.isUndefined(obj.__lookupGetter__(property)) && + obj.__lookupGetter__(property) !== null) : false); + } + }; + + PrettyPrinter.prototype.emitArray = j$.unimplementedMethod_; + PrettyPrinter.prototype.emitObject = j$.unimplementedMethod_; + PrettyPrinter.prototype.emitScalar = j$.unimplementedMethod_; + PrettyPrinter.prototype.emitString = j$.unimplementedMethod_; + + function StringPrettyPrinter() { + PrettyPrinter.call(this); + + this.string = ''; + } + + j$.util.inherit(StringPrettyPrinter, PrettyPrinter); + + StringPrettyPrinter.prototype.emitScalar = function(value) { + this.append(value); + }; + + StringPrettyPrinter.prototype.emitString = function(value) { + this.append('\'' + value + '\''); + }; + + StringPrettyPrinter.prototype.emitArray = function(array) { + if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) { + this.append('Array'); + return; + } + var length = Math.min(array.length, j$.MAX_PRETTY_PRINT_ARRAY_LENGTH); + this.append('[ '); + for (var i = 0; i < length; i++) { + if (i > 0) { + this.append(', '); + } + this.format(array[i]); + } + if(array.length > length){ + this.append(', ...'); + } + + var self = this; + var first = array.length === 0; + this.iterateObject(array, function(property, isGetter) { + if (property.match(/^\d+$/)) { + return; + } + + if (first) { + first = false; + } else { + self.append(', '); + } + + self.formatProperty(array, property, isGetter); + }); + + this.append(' ]'); + }; + + StringPrettyPrinter.prototype.emitObject = function(obj) { + var constructorName = obj.constructor ? j$.fnNameFor(obj.constructor) : 'null'; + this.append(constructorName); + + if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) { + return; + } + + var self = this; + this.append('({ '); + var first = true; + + this.iterateObject(obj, function(property, isGetter) { + if (first) { + first = false; + } else { + self.append(', '); + } + + self.formatProperty(obj, property, isGetter); + }); + + this.append(' })'); + }; + + StringPrettyPrinter.prototype.formatProperty = function(obj, property, isGetter) { + this.append(property); + this.append(': '); + if (isGetter) { + this.append(''); + } else { + this.format(obj[property]); + } + }; + + StringPrettyPrinter.prototype.append = function(value) { + this.string += value; + }; + + return function(value) { + var stringPrettyPrinter = new StringPrettyPrinter(); + stringPrettyPrinter.format(value); + return stringPrettyPrinter.string; + }; +}; + +getJasmineRequireObj().QueueRunner = function(j$) { + + function once(fn) { + var called = false; + return function() { + if (!called) { + called = true; + fn(); + } + }; + } + + function QueueRunner(attrs) { + this.queueableFns = attrs.queueableFns || []; + this.onComplete = attrs.onComplete || function() {}; + this.clearStack = attrs.clearStack || function(fn) {fn();}; + this.onException = attrs.onException || function() {}; + this.catchException = attrs.catchException || function() { return true; }; + this.userContext = attrs.userContext || {}; + this.timeout = attrs.timeout || {setTimeout: setTimeout, clearTimeout: clearTimeout}; + this.fail = attrs.fail || function() {}; + } + + QueueRunner.prototype.execute = function() { + this.run(this.queueableFns, 0); + }; + + QueueRunner.prototype.run = function(queueableFns, recursiveIndex) { + var length = queueableFns.length, + self = this, + iterativeIndex; + + + for(iterativeIndex = recursiveIndex; iterativeIndex < length; iterativeIndex++) { + var queueableFn = queueableFns[iterativeIndex]; + if (queueableFn.fn.length > 0) { + attemptAsync(queueableFn); + return; + } else { + attemptSync(queueableFn); + } + } + + var runnerDone = iterativeIndex >= length; + + if (runnerDone) { + this.clearStack(this.onComplete); + } + + function attemptSync(queueableFn) { + try { + queueableFn.fn.call(self.userContext); + } catch (e) { + handleException(e, queueableFn); + } + } + + function attemptAsync(queueableFn) { + var clearTimeout = function () { + Function.prototype.apply.apply(self.timeout.clearTimeout, [j$.getGlobal(), [timeoutId]]); + }, + next = once(function () { + clearTimeout(timeoutId); + self.run(queueableFns, iterativeIndex + 1); + }), + timeoutId; + + next.fail = function() { + self.fail.apply(null, arguments); + next(); + }; + + if (queueableFn.timeout) { + timeoutId = Function.prototype.apply.apply(self.timeout.setTimeout, [j$.getGlobal(), [function() { + var error = new Error('Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.'); + onException(error); + next(); + }, queueableFn.timeout()]]); + } + + try { + queueableFn.fn.call(self.userContext, next); + } catch (e) { + handleException(e, queueableFn); + next(); + } + } + + function onException(e) { + self.onException(e); + } + + function handleException(e, queueableFn) { + onException(e); + if (!self.catchException(e)) { + //TODO: set a var when we catch an exception and + //use a finally block to close the loop in a nice way.. + throw e; + } + } + }; + + return QueueRunner; +}; + +getJasmineRequireObj().ReportDispatcher = function() { + function ReportDispatcher(methods) { + + var dispatchedMethods = methods || []; + + for (var i = 0; i < dispatchedMethods.length; i++) { + var method = dispatchedMethods[i]; + this[method] = (function(m) { + return function() { + dispatch(m, arguments); + }; + }(method)); + } + + var reporters = []; + + this.addReporter = function(reporter) { + reporters.push(reporter); + }; + + return this; + + function dispatch(method, args) { + for (var i = 0; i < reporters.length; i++) { + var reporter = reporters[i]; + if (reporter[method]) { + reporter[method].apply(reporter, args); + } + } + } + } + + return ReportDispatcher; +}; + + +getJasmineRequireObj().SpyRegistry = function(j$) { + + function SpyRegistry(options) { + options = options || {}; + var currentSpies = options.currentSpies || function() { return []; }; + + this.spyOn = function(obj, methodName) { + if (j$.util.isUndefined(obj)) { + throw new Error('spyOn could not find an object to spy upon for ' + methodName + '()'); + } + + if (j$.util.isUndefined(methodName)) { + throw new Error('No method name supplied'); + } + + if (j$.util.isUndefined(obj[methodName])) { + throw new Error(methodName + '() method does not exist'); + } + + if (obj[methodName] && j$.isSpy(obj[methodName])) { + //TODO?: should this return the current spy? Downside: may cause user confusion about spy state + throw new Error(methodName + ' has already been spied upon'); + } + + var descriptor; + try { + descriptor = Object.getOwnPropertyDescriptor(obj, methodName); + } catch(e) { + // IE 8 doesn't support `definePropery` on non-DOM nodes + } + + if (descriptor && !(descriptor.writable || descriptor.set)) { + throw new Error(methodName + ' is not declared writable or has no setter'); + } + + var spy = j$.createSpy(methodName, obj[methodName]); + + currentSpies().push({ + spy: spy, + baseObj: obj, + methodName: methodName, + originalValue: obj[methodName] + }); + + obj[methodName] = spy; + + return spy; + }; + + this.clearSpies = function() { + var spies = currentSpies(); + for (var i = 0; i < spies.length; i++) { + var spyEntry = spies[i]; + spyEntry.baseObj[spyEntry.methodName] = spyEntry.originalValue; + } + }; + } + + return SpyRegistry; +}; + +getJasmineRequireObj().SpyStrategy = function() { + + function SpyStrategy(options) { + options = options || {}; + + var identity = options.name || 'unknown', + originalFn = options.fn || function() {}, + getSpy = options.getSpy || function() {}, + plan = function() {}; + + this.identity = function() { + return identity; + }; + + this.exec = function() { + return plan.apply(this, arguments); + }; + + this.callThrough = function() { + plan = originalFn; + return getSpy(); + }; + + this.returnValue = function(value) { + plan = function() { + return value; + }; + return getSpy(); + }; + + this.returnValues = function() { + var values = Array.prototype.slice.call(arguments); + plan = function () { + return values.shift(); + }; + return getSpy(); + }; + + this.throwError = function(something) { + var error = (something instanceof Error) ? something : new Error(something); + plan = function() { + throw error; + }; + return getSpy(); + }; + + this.callFake = function(fn) { + plan = fn; + return getSpy(); + }; + + this.stub = function(fn) { + plan = function() {}; + return getSpy(); + }; + } + + return SpyStrategy; +}; + +getJasmineRequireObj().Suite = function(j$) { + function Suite(attrs) { + this.env = attrs.env; + this.id = attrs.id; + this.parentSuite = attrs.parentSuite; + this.description = attrs.description; + this.expectationFactory = attrs.expectationFactory; + this.expectationResultFactory = attrs.expectationResultFactory; + this.throwOnExpectationFailure = !!attrs.throwOnExpectationFailure; + + this.beforeFns = []; + this.afterFns = []; + this.beforeAllFns = []; + this.afterAllFns = []; + this.disabled = false; + + this.children = []; + + this.result = { + id: this.id, + description: this.description, + fullName: this.getFullName(), + failedExpectations: [] + }; + } + + Suite.prototype.expect = function(actual) { + return this.expectationFactory(actual, this); + }; + + Suite.prototype.getFullName = function() { + var fullName = this.description; + for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { + if (parentSuite.parentSuite) { + fullName = parentSuite.description + ' ' + fullName; + } + } + return fullName; + }; + + Suite.prototype.disable = function() { + this.disabled = true; + }; + + Suite.prototype.pend = function(message) { + this.markedPending = true; + }; + + Suite.prototype.beforeEach = function(fn) { + this.beforeFns.unshift(fn); + }; + + Suite.prototype.beforeAll = function(fn) { + this.beforeAllFns.push(fn); + }; + + Suite.prototype.afterEach = function(fn) { + this.afterFns.unshift(fn); + }; + + Suite.prototype.afterAll = function(fn) { + this.afterAllFns.push(fn); + }; + + Suite.prototype.addChild = function(child) { + this.children.push(child); + }; + + Suite.prototype.status = function() { + if (this.disabled) { + return 'disabled'; + } + + if (this.markedPending) { + return 'pending'; + } + + if (this.result.failedExpectations.length > 0) { + return 'failed'; + } else { + return 'finished'; + } + }; + + Suite.prototype.isExecutable = function() { + return !this.disabled; + }; + + Suite.prototype.canBeReentered = function() { + return this.beforeAllFns.length === 0 && this.afterAllFns.length === 0; + }; + + Suite.prototype.getResult = function() { + this.result.status = this.status(); + return this.result; + }; + + Suite.prototype.sharedUserContext = function() { + if (!this.sharedContext) { + this.sharedContext = this.parentSuite ? clone(this.parentSuite.sharedUserContext()) : {}; + } + + return this.sharedContext; + }; + + Suite.prototype.clonedSharedUserContext = function() { + return clone(this.sharedUserContext()); + }; + + Suite.prototype.onException = function() { + if (arguments[0] instanceof j$.errors.ExpectationFailed) { + return; + } + + if(isAfterAll(this.children)) { + var data = { + matcherName: '', + passed: false, + expected: '', + actual: '', + error: arguments[0] + }; + this.result.failedExpectations.push(this.expectationResultFactory(data)); + } else { + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + child.onException.apply(child, arguments); + } + } + }; + + Suite.prototype.addExpectationResult = function () { + if(isAfterAll(this.children) && isFailure(arguments)){ + var data = arguments[1]; + this.result.failedExpectations.push(this.expectationResultFactory(data)); + if(this.throwOnExpectationFailure) { + throw new j$.errors.ExpectationFailed(); + } + } else { + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + try { + child.addExpectationResult.apply(child, arguments); + } catch(e) { + // keep going + } + } + } + }; + + function isAfterAll(children) { + return children && children[0].result.status; + } + + function isFailure(args) { + return !args[0]; + } + + function clone(obj) { + var clonedObj = {}; + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { + clonedObj[prop] = obj[prop]; + } + } + + return clonedObj; + } + + return Suite; +}; + +if (typeof window == void 0 && typeof exports == 'object') { + exports.Suite = jasmineRequire.Suite; +} + +getJasmineRequireObj().Timer = function() { + var defaultNow = (function(Date) { + return function() { return new Date().getTime(); }; + })(Date); + + function Timer(options) { + options = options || {}; + + var now = options.now || defaultNow, + startTime; + + this.start = function() { + startTime = now(); + }; + + this.elapsed = function() { + return now() - startTime; + }; + } + + return Timer; +}; + +getJasmineRequireObj().TreeProcessor = function() { + function TreeProcessor(attrs) { + var tree = attrs.tree, + runnableIds = attrs.runnableIds, + queueRunnerFactory = attrs.queueRunnerFactory, + nodeStart = attrs.nodeStart || function() {}, + nodeComplete = attrs.nodeComplete || function() {}, + orderChildren = attrs.orderChildren || function(node) { return node.children; }, + stats = { valid: true }, + processed = false, + defaultMin = Infinity, + defaultMax = 1 - Infinity; + + this.processTree = function() { + processNode(tree, false); + processed = true; + return stats; + }; + + this.execute = function(done) { + if (!processed) { + this.processTree(); + } + + if (!stats.valid) { + throw 'invalid order'; + } + + var childFns = wrapChildren(tree, 0); + + queueRunnerFactory({ + queueableFns: childFns, + userContext: tree.sharedUserContext(), + onException: function() { + tree.onException.apply(tree, arguments); + }, + onComplete: done + }); + }; + + function runnableIndex(id) { + for (var i = 0; i < runnableIds.length; i++) { + if (runnableIds[i] === id) { + return i; + } + } + } + + function processNode(node, parentEnabled) { + var executableIndex = runnableIndex(node.id); + + if (executableIndex !== undefined) { + parentEnabled = true; + } + + parentEnabled = parentEnabled && node.isExecutable(); + + if (!node.children) { + stats[node.id] = { + executable: parentEnabled && node.isExecutable(), + segments: [{ + index: 0, + owner: node, + nodes: [node], + min: startingMin(executableIndex), + max: startingMax(executableIndex) + }] + }; + } else { + var hasExecutableChild = false; + + var orderedChildren = orderChildren(node); + + for (var i = 0; i < orderedChildren.length; i++) { + var child = orderedChildren[i]; + + processNode(child, parentEnabled); + + if (!stats.valid) { + return; + } + + var childStats = stats[child.id]; + + hasExecutableChild = hasExecutableChild || childStats.executable; + } + + stats[node.id] = { + executable: hasExecutableChild + }; + + segmentChildren(node, orderedChildren, stats[node.id], executableIndex); + + if (!node.canBeReentered() && stats[node.id].segments.length > 1) { + stats = { valid: false }; + } + } + } + + function startingMin(executableIndex) { + return executableIndex === undefined ? defaultMin : executableIndex; + } + + function startingMax(executableIndex) { + return executableIndex === undefined ? defaultMax : executableIndex; + } + + function segmentChildren(node, orderedChildren, nodeStats, executableIndex) { + var currentSegment = { index: 0, owner: node, nodes: [], min: startingMin(executableIndex), max: startingMax(executableIndex) }, + result = [currentSegment], + lastMax = defaultMax, + orderedChildSegments = orderChildSegments(orderedChildren); + + function isSegmentBoundary(minIndex) { + return lastMax !== defaultMax && minIndex !== defaultMin && lastMax < minIndex - 1; + } + + for (var i = 0; i < orderedChildSegments.length; i++) { + var childSegment = orderedChildSegments[i], + maxIndex = childSegment.max, + minIndex = childSegment.min; + + if (isSegmentBoundary(minIndex)) { + currentSegment = {index: result.length, owner: node, nodes: [], min: defaultMin, max: defaultMax}; + result.push(currentSegment); + } + + currentSegment.nodes.push(childSegment); + currentSegment.min = Math.min(currentSegment.min, minIndex); + currentSegment.max = Math.max(currentSegment.max, maxIndex); + lastMax = maxIndex; + } + + nodeStats.segments = result; + } + + function orderChildSegments(children) { + var specifiedOrder = [], + unspecifiedOrder = []; + + for (var i = 0; i < children.length; i++) { + var child = children[i], + segments = stats[child.id].segments; + + for (var j = 0; j < segments.length; j++) { + var seg = segments[j]; + + if (seg.min === defaultMin) { + unspecifiedOrder.push(seg); + } else { + specifiedOrder.push(seg); + } + } + } + + specifiedOrder.sort(function(a, b) { + return a.min - b.min; + }); + + return specifiedOrder.concat(unspecifiedOrder); + } + + function executeNode(node, segmentNumber) { + if (node.children) { + return { + fn: function(done) { + nodeStart(node); + + queueRunnerFactory({ + onComplete: function() { + nodeComplete(node, node.getResult()); + done(); + }, + queueableFns: wrapChildren(node, segmentNumber), + userContext: node.sharedUserContext(), + onException: function() { + node.onException.apply(node, arguments); + } + }); + } + }; + } else { + return { + fn: function(done) { node.execute(done, stats[node.id].executable); } + }; + } + } + + function wrapChildren(node, segmentNumber) { + var result = [], + segmentChildren = stats[node.id].segments[segmentNumber].nodes; + + for (var i = 0; i < segmentChildren.length; i++) { + result.push(executeNode(segmentChildren[i].owner, segmentChildren[i].index)); + } + + if (!stats[node.id].executable) { + return result; + } + + return node.beforeAllFns.concat(result).concat(node.afterAllFns); + } + } + + return TreeProcessor; +}; + +getJasmineRequireObj().Any = function(j$) { + + function Any(expectedObject) { + if (typeof expectedObject === 'undefined') { + throw new TypeError( + 'jasmine.any() expects to be passed a constructor function. ' + + 'Please pass one or use jasmine.anything() to match any object.' + ); + } + this.expectedObject = expectedObject; + } + + Any.prototype.asymmetricMatch = function(other) { + if (this.expectedObject == String) { + return typeof other == 'string' || other instanceof String; + } + + if (this.expectedObject == Number) { + return typeof other == 'number' || other instanceof Number; + } + + if (this.expectedObject == Function) { + return typeof other == 'function' || other instanceof Function; + } + + if (this.expectedObject == Object) { + return typeof other == 'object'; + } + + if (this.expectedObject == Boolean) { + return typeof other == 'boolean'; + } + + return other instanceof this.expectedObject; + }; + + Any.prototype.jasmineToString = function() { + return ''; + }; + + return Any; +}; + +getJasmineRequireObj().Anything = function(j$) { + + function Anything() {} + + Anything.prototype.asymmetricMatch = function(other) { + return !j$.util.isUndefined(other) && other !== null; + }; + + Anything.prototype.jasmineToString = function() { + return ''; + }; + + return Anything; +}; + +getJasmineRequireObj().ArrayContaining = function(j$) { + function ArrayContaining(sample) { + this.sample = sample; + } + + ArrayContaining.prototype.asymmetricMatch = function(other) { + var className = Object.prototype.toString.call(this.sample); + if (className !== '[object Array]') { throw new Error('You must provide an array to arrayContaining, not \'' + this.sample + '\'.'); } + + for (var i = 0; i < this.sample.length; i++) { + var item = this.sample[i]; + if (!j$.matchersUtil.contains(other, item)) { + return false; + } + } + + return true; + }; + + ArrayContaining.prototype.jasmineToString = function () { + return ''; + }; + + return ArrayContaining; +}; + +getJasmineRequireObj().ObjectContaining = function(j$) { + + function ObjectContaining(sample) { + this.sample = sample; + } + + function getPrototype(obj) { + if (Object.getPrototypeOf) { + return Object.getPrototypeOf(obj); + } + + if (obj.constructor.prototype == obj) { + return null; + } + + return obj.constructor.prototype; + } + + function hasProperty(obj, property) { + if (!obj) { + return false; + } + + if (Object.prototype.hasOwnProperty.call(obj, property)) { + return true; + } + + return hasProperty(getPrototype(obj), property); + } + + ObjectContaining.prototype.asymmetricMatch = function(other) { + if (typeof(this.sample) !== 'object') { throw new Error('You must provide an object to objectContaining, not \''+this.sample+'\'.'); } + + for (var property in this.sample) { + if (!hasProperty(other, property) || + !j$.matchersUtil.equals(this.sample[property], other[property])) { + return false; + } + } + + return true; + }; + + ObjectContaining.prototype.jasmineToString = function() { + return ''; + }; + + return ObjectContaining; +}; + +getJasmineRequireObj().StringMatching = function(j$) { + + function StringMatching(expected) { + if (!j$.isString_(expected) && !j$.isA_('RegExp', expected)) { + throw new Error('Expected is not a String or a RegExp'); + } + + this.regexp = new RegExp(expected); + } + + StringMatching.prototype.asymmetricMatch = function(other) { + return this.regexp.test(other); + }; + + StringMatching.prototype.jasmineToString = function() { + return ''; + }; + + return StringMatching; +}; + +getJasmineRequireObj().errors = function() { + function ExpectationFailed() {} + + ExpectationFailed.prototype = new Error(); + ExpectationFailed.prototype.constructor = ExpectationFailed; + + return { + ExpectationFailed: ExpectationFailed + }; +}; +getJasmineRequireObj().matchersUtil = function(j$) { + // TODO: what to do about jasmine.pp not being inject? move to JSON.stringify? gut PrettyPrinter? + + return { + equals: function(a, b, customTesters) { + customTesters = customTesters || []; + + return eq(a, b, [], [], customTesters); + }, + + contains: function(haystack, needle, customTesters) { + customTesters = customTesters || []; + + if ((Object.prototype.toString.apply(haystack) === '[object Array]') || + (!!haystack && !haystack.indexOf)) + { + for (var i = 0; i < haystack.length; i++) { + if (eq(haystack[i], needle, [], [], customTesters)) { + return true; + } + } + return false; + } + + return !!haystack && haystack.indexOf(needle) >= 0; + }, + + buildFailureMessage: function() { + var args = Array.prototype.slice.call(arguments, 0), + matcherName = args[0], + isNot = args[1], + actual = args[2], + expected = args.slice(3), + englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); + + var message = 'Expected ' + + j$.pp(actual) + + (isNot ? ' not ' : ' ') + + englishyPredicate; + + if (expected.length > 0) { + for (var i = 0; i < expected.length; i++) { + if (i > 0) { + message += ','; + } + message += ' ' + j$.pp(expected[i]); + } + } + + return message + '.'; + } + }; + + function isAsymmetric(obj) { + return obj && j$.isA_('Function', obj.asymmetricMatch); + } + + function asymmetricMatch(a, b) { + var asymmetricA = isAsymmetric(a), + asymmetricB = isAsymmetric(b); + + if (asymmetricA && asymmetricB) { + return undefined; + } + + if (asymmetricA) { + return a.asymmetricMatch(b); + } + + if (asymmetricB) { + return b.asymmetricMatch(a); + } + } + + // Equality function lovingly adapted from isEqual in + // [Underscore](http://underscorejs.org) + function eq(a, b, aStack, bStack, customTesters) { + var result = true; + + var asymmetricResult = asymmetricMatch(a, b); + if (!j$.util.isUndefined(asymmetricResult)) { + return asymmetricResult; + } + + for (var i = 0; i < customTesters.length; i++) { + var customTesterResult = customTesters[i](a, b); + if (!j$.util.isUndefined(customTesterResult)) { + return customTesterResult; + } + } + + if (a instanceof Error && b instanceof Error) { + return a.message == b.message; + } + + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) { return a !== 0 || 1 / a == 1 / b; } + // A strict comparison is necessary because `null == undefined`. + if (a === null || b === null) { return a === b; } + var className = Object.prototype.toString.call(a); + if (className != Object.prototype.toString.call(b)) { return false; } + switch (className) { + // Strings, numbers, dates, and booleans are compared by value. + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return a == String(b); + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for + // other numeric values. + return a != +a ? b != +b : (a === 0 ? 1 / a == 1 / b : a == +b); + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a == +b; + // RegExps are compared by their source patterns and flags. + case '[object RegExp]': + return a.source == b.source && + a.global == b.global && + a.multiline == b.multiline && + a.ignoreCase == b.ignoreCase; + } + if (typeof a != 'object' || typeof b != 'object') { return false; } + + var aIsDomNode = j$.isDomNode(a); + var bIsDomNode = j$.isDomNode(b); + if (aIsDomNode && bIsDomNode) { + // At first try to use DOM3 method isEqualNode + if (a.isEqualNode) { + return a.isEqualNode(b); + } + // IE8 doesn't support isEqualNode, try to use outerHTML && innerText + var aIsElement = a instanceof Element; + var bIsElement = b instanceof Element; + if (aIsElement && bIsElement) { + return a.outerHTML == b.outerHTML; + } + if (aIsElement || bIsElement) { + return false; + } + return a.innerText == b.innerText && a.textContent == b.textContent; + } + if (aIsDomNode || bIsDomNode) { + return false; + } + + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] == a) { return bStack[length] == b; } + } + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + var size = 0; + // Recursively compare objects and arrays. + // Compare array lengths to determine if a deep comparison is necessary. + if (className == '[object Array]' && a.length !== b.length) { + result = false; + } + + if (result) { + // Objects with different constructors are not equivalent, but `Object`s + // or `Array`s from different frames are. + if (className !== '[object Array]') { + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && + isFunction(bCtor) && bCtor instanceof bCtor)) { + return false; + } + } + // Deep compare objects. + for (var key in a) { + if (has(a, key)) { + // Count the expected number of properties. + size++; + // Deep compare each member. + if (!(result = has(b, key) && eq(a[key], b[key], aStack, bStack, customTesters))) { break; } + } + } + // Ensure that both objects contain the same number of properties. + if (result) { + for (key in b) { + if (has(b, key) && !(size--)) { break; } + } + result = !size; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + + return result; + + function has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); + } + + function isFunction(obj) { + return typeof obj === 'function'; + } + } +}; + +getJasmineRequireObj().toBe = function() { + function toBe() { + return { + compare: function(actual, expected) { + return { + pass: actual === expected + }; + } + }; + } + + return toBe; +}; + +getJasmineRequireObj().toBeCloseTo = function() { + + function toBeCloseTo() { + return { + compare: function(actual, expected, precision) { + if (precision !== 0) { + precision = precision || 2; + } + + return { + pass: Math.abs(expected - actual) < (Math.pow(10, -precision) / 2) + }; + } + }; + } + + return toBeCloseTo; +}; + +getJasmineRequireObj().toBeDefined = function() { + function toBeDefined() { + return { + compare: function(actual) { + return { + pass: (void 0 !== actual) + }; + } + }; + } + + return toBeDefined; +}; + +getJasmineRequireObj().toBeFalsy = function() { + function toBeFalsy() { + return { + compare: function(actual) { + return { + pass: !!!actual + }; + } + }; + } + + return toBeFalsy; +}; + +getJasmineRequireObj().toBeGreaterThan = function() { + + function toBeGreaterThan() { + return { + compare: function(actual, expected) { + return { + pass: actual > expected + }; + } + }; + } + + return toBeGreaterThan; +}; + + +getJasmineRequireObj().toBeLessThan = function() { + function toBeLessThan() { + return { + + compare: function(actual, expected) { + return { + pass: actual < expected + }; + } + }; + } + + return toBeLessThan; +}; +getJasmineRequireObj().toBeNaN = function(j$) { + + function toBeNaN() { + return { + compare: function(actual) { + var result = { + pass: (actual !== actual) + }; + + if (result.pass) { + result.message = 'Expected actual not to be NaN.'; + } else { + result.message = function() { return 'Expected ' + j$.pp(actual) + ' to be NaN.'; }; + } + + return result; + } + }; + } + + return toBeNaN; +}; + +getJasmineRequireObj().toBeNull = function() { + + function toBeNull() { + return { + compare: function(actual) { + return { + pass: actual === null + }; + } + }; + } + + return toBeNull; +}; + +getJasmineRequireObj().toBeTruthy = function() { + + function toBeTruthy() { + return { + compare: function(actual) { + return { + pass: !!actual + }; + } + }; + } + + return toBeTruthy; +}; + +getJasmineRequireObj().toBeUndefined = function() { + + function toBeUndefined() { + return { + compare: function(actual) { + return { + pass: void 0 === actual + }; + } + }; + } + + return toBeUndefined; +}; + +getJasmineRequireObj().toContain = function() { + function toContain(util, customEqualityTesters) { + customEqualityTesters = customEqualityTesters || []; + + return { + compare: function(actual, expected) { + + return { + pass: util.contains(actual, expected, customEqualityTesters) + }; + } + }; + } + + return toContain; +}; + +getJasmineRequireObj().toEqual = function() { + + function toEqual(util, customEqualityTesters) { + customEqualityTesters = customEqualityTesters || []; + + return { + compare: function(actual, expected) { + var result = { + pass: false + }; + + result.pass = util.equals(actual, expected, customEqualityTesters); + + return result; + } + }; + } + + return toEqual; +}; + +getJasmineRequireObj().toHaveBeenCalled = function(j$) { + + function toHaveBeenCalled() { + return { + compare: function(actual) { + var result = {}; + + if (!j$.isSpy(actual)) { + throw new Error('Expected a spy, but got ' + j$.pp(actual) + '.'); + } + + if (arguments.length > 1) { + throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); + } + + result.pass = actual.calls.any(); + + result.message = result.pass ? + 'Expected spy ' + actual.and.identity() + ' not to have been called.' : + 'Expected spy ' + actual.and.identity() + ' to have been called.'; + + return result; + } + }; + } + + return toHaveBeenCalled; +}; + +getJasmineRequireObj().toHaveBeenCalledTimes = function(j$) { + + function toHaveBeenCalledTimes() { + return { + compare: function(actual, expected) { + if (!j$.isSpy(actual)) { + throw new Error('Expected a spy, but got ' + j$.pp(actual) + '.'); + } + + var args = Array.prototype.slice.call(arguments, 0), + result = { pass: false }; + + if(!expected){ + throw new Error('Expected times failed is required as an argument.'); + } + + actual = args[0]; + var calls = actual.calls.count(); + var timesMessage = expected === 1 ? 'once' : expected + ' times'; + result.pass = calls === expected; + result.message = result.pass ? + 'Expected spy ' + actual.and.identity() + ' not to have been called ' + timesMessage + '. It was called ' + calls + ' times.' : + 'Expected spy ' + actual.and.identity() + ' to have been called ' + timesMessage + '. It was called ' + calls + ' times.'; + return result; + } + }; + } + + return toHaveBeenCalledTimes; +}; + +getJasmineRequireObj().toHaveBeenCalledWith = function(j$) { + + function toHaveBeenCalledWith(util, customEqualityTesters) { + return { + compare: function() { + var args = Array.prototype.slice.call(arguments, 0), + actual = args[0], + expectedArgs = args.slice(1), + result = { pass: false }; + + if (!j$.isSpy(actual)) { + throw new Error('Expected a spy, but got ' + j$.pp(actual) + '.'); + } + + if (!actual.calls.any()) { + result.message = function() { return 'Expected spy ' + actual.and.identity() + ' to have been called with ' + j$.pp(expectedArgs) + ' but it was never called.'; }; + return result; + } + + if (util.contains(actual.calls.allArgs(), expectedArgs, customEqualityTesters)) { + result.pass = true; + result.message = function() { return 'Expected spy ' + actual.and.identity() + ' not to have been called with ' + j$.pp(expectedArgs) + ' but it was.'; }; + } else { + result.message = function() { return 'Expected spy ' + actual.and.identity() + ' to have been called with ' + j$.pp(expectedArgs) + ' but actual calls were ' + j$.pp(actual.calls.allArgs()).replace(/^\[ | \]$/g, '') + '.'; }; + } + + return result; + } + }; + } + + return toHaveBeenCalledWith; +}; + +getJasmineRequireObj().toMatch = function(j$) { + + function toMatch() { + return { + compare: function(actual, expected) { + if (!j$.isString_(expected) && !j$.isA_('RegExp', expected)) { + throw new Error('Expected is not a String or a RegExp'); + } + + var regexp = new RegExp(expected); + + return { + pass: regexp.test(actual) + }; + } + }; + } + + return toMatch; +}; + +getJasmineRequireObj().toThrow = function(j$) { + + function toThrow(util) { + return { + compare: function(actual, expected) { + var result = { pass: false }, + threw = false, + thrown; + + if (typeof actual != 'function') { + throw new Error('Actual is not a Function'); + } + + try { + actual(); + } catch (e) { + threw = true; + thrown = e; + } + + if (!threw) { + result.message = 'Expected function to throw an exception.'; + return result; + } + + if (arguments.length == 1) { + result.pass = true; + result.message = function() { return 'Expected function not to throw, but it threw ' + j$.pp(thrown) + '.'; }; + + return result; + } + + if (util.equals(thrown, expected)) { + result.pass = true; + result.message = function() { return 'Expected function not to throw ' + j$.pp(expected) + '.'; }; + } else { + result.message = function() { return 'Expected function to throw ' + j$.pp(expected) + ', but it threw ' + j$.pp(thrown) + '.'; }; + } + + return result; + } + }; + } + + return toThrow; +}; + +getJasmineRequireObj().toThrowError = function(j$) { + function toThrowError () { + return { + compare: function(actual) { + var threw = false, + pass = {pass: true}, + fail = {pass: false}, + thrown; + + if (typeof actual != 'function') { + throw new Error('Actual is not a Function'); + } + + var errorMatcher = getMatcher.apply(null, arguments); + + try { + actual(); + } catch (e) { + threw = true; + thrown = e; + } + + if (!threw) { + fail.message = 'Expected function to throw an Error.'; + return fail; + } + + if (!(thrown instanceof Error)) { + fail.message = function() { return 'Expected function to throw an Error, but it threw ' + j$.pp(thrown) + '.'; }; + return fail; + } + + if (errorMatcher.hasNoSpecifics()) { + pass.message = 'Expected function not to throw an Error, but it threw ' + j$.fnNameFor(thrown) + '.'; + return pass; + } + + if (errorMatcher.matches(thrown)) { + pass.message = function() { + return 'Expected function not to throw ' + errorMatcher.errorTypeDescription + errorMatcher.messageDescription() + '.'; + }; + return pass; + } else { + fail.message = function() { + return 'Expected function to throw ' + errorMatcher.errorTypeDescription + errorMatcher.messageDescription() + + ', but it threw ' + errorMatcher.thrownDescription(thrown) + '.'; + }; + return fail; + } + } + }; + + function getMatcher() { + var expected = null, + errorType = null; + + if (arguments.length == 2) { + expected = arguments[1]; + if (isAnErrorType(expected)) { + errorType = expected; + expected = null; + } + } else if (arguments.length > 2) { + errorType = arguments[1]; + expected = arguments[2]; + if (!isAnErrorType(errorType)) { + throw new Error('Expected error type is not an Error.'); + } + } + + if (expected && !isStringOrRegExp(expected)) { + if (errorType) { + throw new Error('Expected error message is not a string or RegExp.'); + } else { + throw new Error('Expected is not an Error, string, or RegExp.'); + } + } + + function messageMatch(message) { + if (typeof expected == 'string') { + return expected == message; + } else { + return expected.test(message); + } + } + + return { + errorTypeDescription: errorType ? j$.fnNameFor(errorType) : 'an exception', + thrownDescription: function(thrown) { + var thrownName = errorType ? j$.fnNameFor(thrown.constructor) : 'an exception', + thrownMessage = ''; + + if (expected) { + thrownMessage = ' with message ' + j$.pp(thrown.message); + } + + return thrownName + thrownMessage; + }, + messageDescription: function() { + if (expected === null) { + return ''; + } else if (expected instanceof RegExp) { + return ' with a message matching ' + j$.pp(expected); + } else { + return ' with message ' + j$.pp(expected); + } + }, + hasNoSpecifics: function() { + return expected === null && errorType === null; + }, + matches: function(error) { + return (errorType === null || error instanceof errorType) && + (expected === null || messageMatch(error.message)); + } + }; + } + + function isStringOrRegExp(potential) { + return potential instanceof RegExp || (typeof potential == 'string'); + } + + function isAnErrorType(type) { + if (typeof type !== 'function') { + return false; + } + + var Surrogate = function() {}; + Surrogate.prototype = type.prototype; + return (new Surrogate()) instanceof Error; + } + } + + return toThrowError; +}; + +getJasmineRequireObj().interface = function(jasmine, env) { + var jasmineInterface = { + describe: function(description, specDefinitions) { + return env.describe(description, specDefinitions); + }, + + xdescribe: function(description, specDefinitions) { + return env.xdescribe(description, specDefinitions); + }, + + fdescribe: function(description, specDefinitions) { + return env.fdescribe(description, specDefinitions); + }, + + it: function() { + return env.it.apply(env, arguments); + }, + + xit: function() { + return env.xit.apply(env, arguments); + }, + + fit: function() { + return env.fit.apply(env, arguments); + }, + + beforeEach: function() { + return env.beforeEach.apply(env, arguments); + }, + + afterEach: function() { + return env.afterEach.apply(env, arguments); + }, + + beforeAll: function() { + return env.beforeAll.apply(env, arguments); + }, + + afterAll: function() { + return env.afterAll.apply(env, arguments); + }, + + expect: function(actual) { + return env.expect(actual); + }, + + pending: function() { + return env.pending.apply(env, arguments); + }, + + fail: function() { + return env.fail.apply(env, arguments); + }, + + spyOn: function(obj, methodName) { + return env.spyOn(obj, methodName); + }, + + jsApiReporter: new jasmine.JsApiReporter({ + timer: new jasmine.Timer() + }), + + jasmine: jasmine + }; + + jasmine.addCustomEqualityTester = function(tester) { + env.addCustomEqualityTester(tester); + }; + + jasmine.addMatchers = function(matchers) { + return env.addMatchers(matchers); + }; + + jasmine.clock = function() { + return env.clock; + }; + + return jasmineInterface; +}; + +getJasmineRequireObj().version = function() { + return '2.4.1'; +}; diff --git a/tests/jasmine/lib/jasmine-2.4.1/jasmine_favicon.png b/tests/jasmine/lib/jasmine-2.4.1/jasmine_favicon.png new file mode 100644 index 0000000..3b84583 Binary files /dev/null and b/tests/jasmine/lib/jasmine-2.4.1/jasmine_favicon.png differ diff --git a/tests/jasmine/spec/NintexServicesSpec.js b/tests/jasmine/spec/NintexServicesSpec.js new file mode 100644 index 0000000..0059de9 --- /dev/null +++ b/tests/jasmine/spec/NintexServicesSpec.js @@ -0,0 +1,109 @@ +describe("NintexServices", function() { + + var WEBURL = "{InsertTestSiteHere}"; + var TESTLIST = "Tasks"; + var TESTWFNAME = "TaskWFSave"; + var TESTLISTID = null; + var TESTWFID = null; + + $().SPServices({ + webURL: WEBURL, + operation: "GetList", + listName: TESTLIST, + async: false, + completefunc: function(xData, Status){ + TESTLISTID = $(xData.responseXML).find("List").attr("ID"); + } + });//End Get List id + beforeEach(function() { + + });//end beforeEach + + it("should exist", function(){ + expect($().NintexServices).toBeDefined(); + }); + + it("TESTLISTID should not be null", function(){ + expect(TESTLISTID).not.toBe(null); + }); + + it("show work with SaveFromNWF operation", function(){ + $().NintexServices({ + webURL: WEBURL, + operation: "SaveFromNWF", + workflowFile: BASE64ENCODEDWF, + listName: "Tasks", + workflowName: TESTWFNAME, + async: false, + completefunc: function(xData, Status) { + expect(Status).toEqual('success'); + TESTWFID = $(xData.responseXML).find("WorkflowId").text(); + expect(TESTWFID).not.toBe(null); + } + }); + }); + + //Export Workflow + it("should work with ExportWorkflow operation", function(){ + $().NintexServices({ + webURL: WEBURL, + operation: "ExportWorkflow", + listName: "Tasks", + workflowType: "list", + workflowName: TESTWFNAME, + async: false, + completefunc: function(xData, Status) { + expect(Status).toEqual('success'); + } + }); + }); + + //Workflow Exists + it("should work with WorkflowExists operation", function(){ + $().NintexServices({ + webURL: WEBURL, + operation: "WorkflowExists", + workflowName: TESTWFNAME, + listId: TESTWFID, + workflowType: "list", + async: false, + completefunc: function(xData, Status) { + expect(Status).toEqual('success'); + expect($(xData.responseXML).find("WorkflowExistsResult").text()).toEqual("NameUsedInOtherList"); + } + }); + }); + + //Delete Workflow + it("should work with DeleteWorkflow operation", function(){ + $().NintexServices({ + webURL: WEBURL, + operation: "DeleteWorkflow", + listId: TESTLISTID, + workflowId: TESTWFID, + workflowType: "list", + async: false, + completefunc: function(xData, Status) { + expect(Status).toEqual('success'); + } + }); + }); + + //Workflow Exists + it(TESTWFNAME + " should not exist", function(){ + $().NintexServices({ + webURL: WEBURL, + operation: "WorkflowExists", + workflowName: TESTWFNAME, + listId: TESTWFID, + workflowType: "list", + async: false, + completefunc: function(xData, Status) { + expect(Status).toEqual('success'); + expect($(xData.responseXML).find("WorkflowExistsResult").text()).toEqual("NameNotUsed"); + } + }); + }); + + +}); diff --git a/tests/jasmine/src/Base64EncodedWF.js b/tests/jasmine/src/Base64EncodedWF.js new file mode 100644 index 0000000..d7d61dd --- /dev/null +++ b/tests/jasmine/src/Base64EncodedWF.js @@ -0,0 +1 @@ +var BASE64ENCODEDWF = "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48RXhwb3J0ZWRXb3JrZmxvd1dpdGhMaXN0TWV0ZGF0YSB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4bWxuczp4c2Q9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIj48RXhwb3J0ZWRXb3JrZmxvd1NlcmFsaXplZD4mbHQ7P3htbCB2ZXJzaW9uPSIxLjAiIGVuY29kaW5nPSJ1dGYtOCI/Jmd0OyZsdDtFeHBvcnRlZFdvcmtmbG93IHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiJmd0OyZsdDtUaXRsZSZndDtUYXNrV0YmbHQ7L1RpdGxlJmd0OyZsdDtEZXNjcmlwdGlvbiAvJmd0OyZsdDtDb25maWd1cmF0aW9ucyZndDsm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GVybmFsTmFtZT48RGlzcGxheU5hbWU+SXRlbSBDaGlsZCBDb3VudDwvRGlzcGxheU5hbWU+PEZpZWxkVHlwZT5Mb29rdXA8L0ZpZWxkVHlwZT48L0ZpZWxkUmVmZXJlbmNlPjxGaWVsZFJlZmVyZW5jZT48SW50ZXJuYWxOYW1lPkZvbGRlckNoaWxkQ291bnQ8L0ludGVybmFsTmFtZT48RGlzcGxheU5hbWU+Rm9sZGVyIENoaWxkIENvdW50PC9EaXNwbGF5TmFtZT48RmllbGRUeXBlPkxvb2t1cDwvRmllbGRUeXBlPjwvRmllbGRSZWZlcmVuY2U+PC9GaWVsZHM+PExpc3ROYW1lPlRhc2tzPC9MaXN0TmFtZT48TGlzdElkPjU5ZTI5ZmJkLWRjZTgtNGI2Ni1hYzBmLTU3NzFlM2E3YmIxMDwvTGlzdElkPjwvTGlzdFJlZmVyZW5jZT48L0xpc3RSZWZlcmVuY2VzPjxWZXJzaW9uPjIzMTMwPC9WZXJzaW9uPjxXb3JrZmxvd1R5cGU+TGlzdDwvV29ya2Zsb3dUeXBlPjxXb3JrZmxvd0lkPjRhNDU1MjI4LTU3MDAtNDQxMC1hNmQyLTRjNDA3MDEyZDNmMTwvV29ya2Zsb3dJZD48L0V4cG9ydGVkV29ya2Zsb3dXaXRoTGlzdE1ldGRhdGE+" \ No newline at end of file diff --git a/tests/jasmine/src/jquery-1.11.3.min.js b/tests/jasmine/src/jquery-1.11.3.min.js new file mode 100644 index 0000000..0f60b7b --- /dev/null +++ b/tests/jasmine/src/jquery-1.11.3.min.js @@ -0,0 +1,5 @@ +/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="
    ",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1; + +return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
    a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/\s*$/g,ra={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:k.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?""!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("