]*data-sp-htmlproperties[^>]*?>/i, function (markup) {\r\n return markup.replace(/^
]*data-sp-htmlproperties[^>]*?>/i, \"\").replace(/<\\/div>$/i, \"\");\r\n });\r\n this.htmlProperties = htmlProps.length > 0 ? htmlProps[0] : \"\";\r\n };\r\n ClientSideWebpart.prototype.getControlData = function () {\r\n return {\r\n controlType: this.controlType,\r\n id: this.id,\r\n position: {\r\n controlIndex: this.order,\r\n sectionFactor: this.column.factor,\r\n sectionIndex: this.column.order,\r\n zoneIndex: this.column.section.order,\r\n },\r\n webPartId: this.webPartId,\r\n };\r\n };\r\n ClientSideWebpart.prototype.renderHtmlProperties = function () {\r\n var html = [];\r\n if (this.serverProcessedContent === undefined || this.serverProcessedContent === null) {\r\n html.push(this.htmlProperties);\r\n }\r\n else if (this.serverProcessedContent !== undefined) {\r\n if (this.serverProcessedContent.searchablePlainTexts !== undefined) {\r\n var keys = Object.keys(this.serverProcessedContent.searchablePlainTexts);\r\n for (var i = 0; i < keys.length; i++) {\r\n html.push(\"
\");\r\n html.push(this.serverProcessedContent.searchablePlainTexts[keys[i]]);\r\n html.push(\"
\");\r\n }\r\n }\r\n if (this.serverProcessedContent.imageSources !== undefined) {\r\n var keys = Object.keys(this.serverProcessedContent.imageSources);\r\n for (var i = 0; i < keys.length; i++) {\r\n html.push(\"
\");\r\n }\r\n }\r\n if (this.serverProcessedContent.links !== undefined) {\r\n var keys = Object.keys(this.serverProcessedContent.links);\r\n for (var i = 0; i < keys.length; i++) {\r\n html.push(\"
\");\r\n }\r\n }\r\n }\r\n return html.join(\"\");\r\n };\r\n ClientSideWebpart.prototype.parseJsonProperties = function (props) {\r\n // If the web part has the serverProcessedContent property then keep this one as it might be needed as input to render the web part HTML later on\r\n if (props.webPartData !== undefined && props.webPartData.serverProcessedContent !== undefined) {\r\n this.serverProcessedContent = props.webPartData.serverProcessedContent;\r\n }\r\n else if (props.serverProcessedContent !== undefined) {\r\n this.serverProcessedContent = props.serverProcessedContent;\r\n }\r\n else {\r\n this.serverProcessedContent = null;\r\n }\r\n if (props.webPartData !== undefined && props.webPartData.properties !== undefined) {\r\n return props.webPartData.properties;\r\n }\r\n else if (props.properties !== undefined) {\r\n return props.properties;\r\n }\r\n else {\r\n return props;\r\n }\r\n };\r\n return ClientSideWebpart;\r\n}(ClientSidePart));\n\n/**\r\n * Represents a collection of navigation nodes\r\n *\r\n */\r\nvar NavigationNodes = /** @class */ (function (_super) {\r\n __extends(NavigationNodes, _super);\r\n function NavigationNodes() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Gets a navigation node by id\r\n *\r\n * @param id The id of the node\r\n */\r\n NavigationNodes.prototype.getById = function (id) {\r\n var node = new NavigationNode(this);\r\n node.concat(\"(\" + id + \")\");\r\n return node;\r\n };\r\n /**\r\n * Adds a new node to the collection\r\n *\r\n * @param title Display name of the node\r\n * @param url The url of the node\r\n * @param visible If true the node is visible, otherwise it is hidden (default: true)\r\n */\r\n NavigationNodes.prototype.add = function (title, url, visible) {\r\n var _this = this;\r\n if (visible === void 0) { visible = true; }\r\n var postBody = jsS(extend(metadata(\"SP.NavigationNode\"), {\r\n IsVisible: visible,\r\n Title: title,\r\n Url: url,\r\n }));\r\n return this.clone(NavigationNodes, null).postCore({ body: postBody }).then(function (data) {\r\n return {\r\n data: data,\r\n node: _this.getById(data.Id),\r\n };\r\n });\r\n };\r\n /**\r\n * Moves a node to be after another node in the navigation\r\n *\r\n * @param nodeId Id of the node to move\r\n * @param previousNodeId Id of the node after which we move the node specified by nodeId\r\n */\r\n NavigationNodes.prototype.moveAfter = function (nodeId, previousNodeId) {\r\n var postBody = jsS({\r\n nodeId: nodeId,\r\n previousNodeId: previousNodeId,\r\n });\r\n return this.clone(NavigationNodes, \"MoveAfter\").postCore({ body: postBody });\r\n };\r\n return NavigationNodes;\r\n}(SharePointQueryableCollection));\r\n/**\r\n * Represents an instance of a navigation node\r\n *\r\n */\r\nvar NavigationNode = /** @class */ (function (_super) {\r\n __extends(NavigationNode, _super);\r\n function NavigationNode() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(NavigationNode.prototype, \"children\", {\r\n /**\r\n * Represents the child nodes of this node\r\n */\r\n get: function () {\r\n return new NavigationNodes(this, \"Children\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Deletes this node and any child nodes\r\n */\r\n NavigationNode.prototype.delete = function () {\r\n return _super.prototype.deleteCore.call(this);\r\n };\r\n return NavigationNode;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Exposes the navigation components\r\n *\r\n */\r\nvar Navigation = /** @class */ (function (_super) {\r\n __extends(Navigation, _super);\r\n function Navigation() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(Navigation.prototype, \"quicklaunch\", {\r\n /**\r\n * Gets the quicklaunch navigation nodes for the current context\r\n *\r\n */\r\n get: function () {\r\n return new NavigationNodes(this, \"quicklaunch\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Navigation.prototype, \"topNavigationBar\", {\r\n /**\r\n * Gets the top bar navigation nodes for the current context\r\n *\r\n */\r\n get: function () {\r\n return new NavigationNodes(this, \"topnavigationbar\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Navigation = __decorate([\r\n defaultPath(\"navigation\")\r\n ], Navigation);\r\n return Navigation;\r\n}(SharePointQueryable));\r\n/**\r\n * Represents the top level navigation service\r\n */\r\nvar NavigationService = /** @class */ (function (_super) {\r\n __extends(NavigationService, _super);\r\n function NavigationService(path) {\r\n if (path === void 0) { path = null; }\r\n return _super.call(this, \"_api/navigation\", path) || this;\r\n }\r\n /**\r\n * The MenuState service operation returns a Menu-State (dump) of a SiteMapProvider on a site.\r\n *\r\n * @param menuNodeKey MenuNode.Key of the start node within the SiteMapProvider If no key is provided the SiteMapProvider.RootNode will be the root of the menu state.\r\n * @param depth Depth of the dump. If no value is provided a dump with the depth of 10 is returned\r\n * @param mapProviderName The name identifying the SiteMapProvider to be used\r\n * @param customProperties comma seperated list of custom properties to be returned.\r\n */\r\n NavigationService.prototype.getMenuState = function (menuNodeKey, depth, mapProviderName, customProperties) {\r\n if (menuNodeKey === void 0) { menuNodeKey = null; }\r\n if (depth === void 0) { depth = 10; }\r\n if (mapProviderName === void 0) { mapProviderName = null; }\r\n if (customProperties === void 0) { customProperties = null; }\r\n return (new NavigationService(\"MenuState\")).postCore({\r\n body: jsS({\r\n customProperties: customProperties,\r\n depth: depth,\r\n mapProviderName: mapProviderName,\r\n menuNodeKey: menuNodeKey,\r\n }),\r\n });\r\n };\r\n /**\r\n * Tries to get a SiteMapNode.Key for a given URL within a site collection.\r\n *\r\n * @param currentUrl A url representing the SiteMapNode\r\n * @param mapProviderName The name identifying the SiteMapProvider to be used\r\n */\r\n NavigationService.prototype.getMenuNodeKey = function (currentUrl, mapProviderName) {\r\n if (mapProviderName === void 0) { mapProviderName = null; }\r\n return (new NavigationService(\"MenuNodeKey\")).postCore({\r\n body: jsS({\r\n currentUrl: currentUrl,\r\n mapProviderName: mapProviderName,\r\n }),\r\n });\r\n };\r\n return NavigationService;\r\n}(SharePointQueryable));\n\n/**\r\n * Describes regional settings ODada object\r\n */\r\nvar RegionalSettings = /** @class */ (function (_super) {\r\n __extends(RegionalSettings, _super);\r\n function RegionalSettings() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(RegionalSettings.prototype, \"installedLanguages\", {\r\n /**\r\n * Gets the collection of languages used in a server farm.\r\n */\r\n get: function () {\r\n return new InstalledLanguages(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RegionalSettings.prototype, \"globalInstalledLanguages\", {\r\n /**\r\n * Gets the collection of language packs that are installed on the server.\r\n */\r\n get: function () {\r\n return new InstalledLanguages(this, \"globalinstalledlanguages\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RegionalSettings.prototype, \"timeZone\", {\r\n /**\r\n * Gets time zone\r\n */\r\n get: function () {\r\n return new TimeZone(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RegionalSettings.prototype, \"timeZones\", {\r\n /**\r\n * Gets time zones\r\n */\r\n get: function () {\r\n return new TimeZones(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n RegionalSettings = __decorate([\r\n defaultPath(\"regionalsettings\")\r\n ], RegionalSettings);\r\n return RegionalSettings;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Describes installed languages ODada queriable collection\r\n */\r\nvar InstalledLanguages = /** @class */ (function (_super) {\r\n __extends(InstalledLanguages, _super);\r\n function InstalledLanguages() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n InstalledLanguages = __decorate([\r\n defaultPath(\"installedlanguages\")\r\n ], InstalledLanguages);\r\n return InstalledLanguages;\r\n}(SharePointQueryableCollection));\r\n/**\r\n * Describes TimeZone ODada object\r\n */\r\nvar TimeZone = /** @class */ (function (_super) {\r\n __extends(TimeZone, _super);\r\n function TimeZone() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TimeZone_1 = TimeZone;\r\n /**\r\n * Gets an Local Time by UTC Time\r\n *\r\n * @param utcTime UTC Time as Date or ISO String\r\n */\r\n TimeZone.prototype.utcToLocalTime = function (utcTime) {\r\n var dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, \"utctolocaltime('\" + dateIsoString + \"')\")\r\n .postCore()\r\n .then(function (res) { return hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res; });\r\n };\r\n /**\r\n * Gets an UTC Time by Local Time\r\n *\r\n * @param localTime Local Time as Date or ISO String\r\n */\r\n TimeZone.prototype.localTimeToUTC = function (localTime) {\r\n var dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, \"localtimetoutc('\" + dateIsoString + \"')\")\r\n .postCore()\r\n .then(function (res) { return hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res; });\r\n };\r\n var TimeZone_1;\r\n TimeZone = TimeZone_1 = __decorate([\r\n defaultPath(\"timezone\")\r\n ], TimeZone);\r\n return TimeZone;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Describes time zones queriable collection\r\n */\r\nvar TimeZones = /** @class */ (function (_super) {\r\n __extends(TimeZones, _super);\r\n function TimeZones() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TimeZones_1 = TimeZones;\r\n // https://msdn.microsoft.com/en-us/library/office/jj247008.aspx - timezones ids\r\n /**\r\n * Gets an TimeZone by id\r\n *\r\n * @param id The integer id of the timezone to retrieve\r\n */\r\n TimeZones.prototype.getById = function (id) {\r\n // do the post and merge the result into a TimeZone instance so the data and methods are available\r\n return this.clone(TimeZones_1, \"GetById(\" + id + \")\").postCore({}, spODataEntity(TimeZone));\r\n };\r\n var TimeZones_1;\r\n TimeZones = TimeZones_1 = __decorate([\r\n defaultPath(\"timezones\")\r\n ], TimeZones);\r\n return TimeZones;\r\n}(SharePointQueryableCollection));\n\nvar funcs = new Map([\r\n [\"text\", \"Querytext\"],\r\n [\"template\", \"QueryTemplate\"],\r\n [\"sourceId\", \"SourceId\"],\r\n [\"trimDuplicatesIncludeId\", \"\"],\r\n [\"startRow\", \"\"],\r\n [\"rowLimit\", \"\"],\r\n [\"rankingModelId\", \"\"],\r\n [\"rowsPerPage\", \"\"],\r\n [\"selectProperties\", \"\"],\r\n [\"culture\", \"\"],\r\n [\"timeZoneId\", \"\"],\r\n [\"refinementFilters\", \"\"],\r\n [\"refiners\", \"\"],\r\n [\"hiddenConstraints\", \"\"],\r\n [\"sortList\", \"\"],\r\n [\"timeout\", \"\"],\r\n [\"hithighlightedProperties\", \"\"],\r\n [\"clientType\", \"\"],\r\n [\"personalizationData\", \"\"],\r\n [\"resultsURL\", \"\"],\r\n [\"queryTag\", \"\"],\r\n [\"properties\", \"\"],\r\n [\"queryTemplatePropertiesUrl\", \"\"],\r\n [\"reorderingRules\", \"\"],\r\n [\"hitHighlightedMultivaluePropertyLimit\", \"\"],\r\n [\"collapseSpecification\", \"\"],\r\n [\"uiLanguage\", \"\"],\r\n [\"desiredSnippetLength\", \"\"],\r\n [\"maxSnippetLength\", \"\"],\r\n [\"summaryLength\", \"\"],\r\n]);\r\nvar props = new Map([]);\r\nfunction toPropCase(str) {\r\n return str.replace(/^(.)/, function ($1) { return $1.toUpperCase(); });\r\n}\r\n/**\r\n * Creates a new instance of the SearchQueryBuilder\r\n *\r\n * @param queryText Initial query text\r\n * @param _query Any initial query configuration\r\n */\r\nfunction SearchQueryBuilder(queryText, _query) {\r\n if (queryText === void 0) { queryText = \"\"; }\r\n if (_query === void 0) { _query = {}; }\r\n return new Proxy({\r\n query: Object.assign({\r\n Querytext: queryText,\r\n }, _query),\r\n }, {\r\n get: function (self, propertyKey, proxy) {\r\n var pk = propertyKey.toString();\r\n if (pk === \"toSearchQuery\") {\r\n return function () { return self.query; };\r\n }\r\n if (funcs.has(pk)) {\r\n return function () {\r\n var value = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n value[_i] = arguments[_i];\r\n }\r\n var mappedPk = funcs.get(pk);\r\n self.query[mappedPk.length > 0 ? mappedPk : toPropCase(pk)] = value.length > 1 ? value : value[0];\r\n return proxy;\r\n };\r\n }\r\n var propKey = props.has(pk) ? props.get(pk) : toPropCase(pk);\r\n self.query[propKey] = true;\r\n return proxy;\r\n },\r\n });\r\n}\r\n/**\r\n * Describes the search API\r\n *\r\n */\r\nvar Search = /** @class */ (function (_super) {\r\n __extends(Search, _super);\r\n function Search() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * @returns Promise\r\n */\r\n Search.prototype.execute = function (queryInit) {\r\n var _this = this;\r\n var query = this.parseQuery(queryInit);\r\n var formattedBody;\r\n formattedBody = query;\r\n if (formattedBody.SelectProperties) {\r\n formattedBody.SelectProperties = this.fixupProp(query.SelectProperties);\r\n }\r\n if (formattedBody.RefinementFilters) {\r\n formattedBody.RefinementFilters = this.fixupProp(query.RefinementFilters);\r\n }\r\n if (formattedBody.SortList) {\r\n formattedBody.SortList = this.fixupProp(query.SortList);\r\n }\r\n if (formattedBody.HithighlightedProperties) {\r\n formattedBody.HithighlightedProperties = this.fixupProp(query.HitHighlightedProperties);\r\n }\r\n if (formattedBody.ReorderingRules) {\r\n formattedBody.ReorderingRules = this.fixupProp(query.ReorderingRules);\r\n }\r\n if (formattedBody.Properties) {\r\n formattedBody.Properties = this.fixupProp(query.Properties);\r\n }\r\n var postBody = jsS({\r\n request: extend(metadata(\"Microsoft.Office.Server.Search.REST.SearchRequest\"), formattedBody),\r\n });\r\n // if we are using caching with this search request, then we need to handle some work upfront to enable that\r\n if (this._useCaching) {\r\n // force use of the cache for this request if .usingCaching was called\r\n this._forceCaching = true;\r\n // because all the requests use the same url they would collide in the cache we use a special key\r\n var cacheKey = \"PnPjs.SearchWithCaching(\" + getHashCode(postBody) + \")\";\r\n if (objectDefinedNotNull(this._cachingOptions)) {\r\n // if our key ends in the postquery url we overwrite it\r\n if (/\\/_api\\/search\\/postquery$/i.test(this._cachingOptions.key)) {\r\n this._cachingOptions.key = cacheKey;\r\n }\r\n }\r\n else {\r\n this._cachingOptions = new CachingOptions(cacheKey);\r\n }\r\n }\r\n return this.postCore({ body: postBody }).then(function (data) { return new SearchResults(data, _this.toUrl(), query); });\r\n };\r\n /**\r\n * Fixes up properties that expect to consist of a \"results\" collection when needed\r\n *\r\n * @param prop property to fixup for container struct\r\n */\r\n Search.prototype.fixupProp = function (prop) {\r\n return hOP(prop, \"results\") ? prop : { results: prop };\r\n };\r\n /**\r\n * Translates one of the query initializers into a SearchQuery instance\r\n *\r\n * @param query\r\n */\r\n Search.prototype.parseQuery = function (query) {\r\n var finalQuery;\r\n if (typeof query === \"string\") {\r\n finalQuery = { Querytext: query };\r\n }\r\n else if (query.toSearchQuery) {\r\n finalQuery = query.toSearchQuery();\r\n }\r\n else {\r\n finalQuery = query;\r\n }\r\n return finalQuery;\r\n };\r\n Search = __decorate([\r\n defaultPath(\"_api/search/postquery\")\r\n ], Search);\r\n return Search;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Describes the SearchResults class, which returns the formatted and raw version of the query response\r\n */\r\nvar SearchResults = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the SearchResult class\r\n *\r\n */\r\n function SearchResults(rawResponse, _url, _query, _raw, _primary) {\r\n if (_raw === void 0) { _raw = null; }\r\n if (_primary === void 0) { _primary = null; }\r\n this._url = _url;\r\n this._query = _query;\r\n this._raw = _raw;\r\n this._primary = _primary;\r\n this._raw = rawResponse.postquery ? rawResponse.postquery : rawResponse;\r\n }\r\n Object.defineProperty(SearchResults.prototype, \"ElapsedTime\", {\r\n get: function () {\r\n return this.RawSearchResults.ElapsedTime;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"RowCount\", {\r\n get: function () {\r\n return this.RawSearchResults.PrimaryQueryResult.RelevantResults.RowCount;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"TotalRows\", {\r\n get: function () {\r\n return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRows;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"TotalRowsIncludingDuplicates\", {\r\n get: function () {\r\n return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"RawSearchResults\", {\r\n get: function () {\r\n return this._raw;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"PrimarySearchResults\", {\r\n get: function () {\r\n if (this._primary === null) {\r\n this._primary = this.formatSearchResults(this._raw.PrimaryQueryResult.RelevantResults.Table.Rows);\r\n }\r\n return this._primary;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets a page of results\r\n *\r\n * @param pageNumber Index of the page to return. Used to determine StartRow\r\n * @param pageSize Optional, items per page (default = 10)\r\n */\r\n SearchResults.prototype.getPage = function (pageNumber, pageSize) {\r\n // if we got all the available rows we don't have another page\r\n if (this.TotalRows < this.RowCount) {\r\n return Promise.resolve(null);\r\n }\r\n // if pageSize is supplied, then we use that regardless of any previous values\r\n // otherwise get the previous RowLimit or default to 10\r\n var rows = pageSize !== undefined ? pageSize : hOP(this._query, \"RowLimit\") ? this._query.RowLimit : 10;\r\n var query = extend(this._query, {\r\n RowLimit: rows,\r\n StartRow: rows * (pageNumber - 1),\r\n });\r\n // we have reached the end\r\n if (query.StartRow > this.TotalRows) {\r\n return Promise.resolve(null);\r\n }\r\n var search = new Search(this._url, null);\r\n return search.execute(query);\r\n };\r\n /**\r\n * Formats a search results array\r\n *\r\n * @param rawResults The array to process\r\n */\r\n SearchResults.prototype.formatSearchResults = function (rawResults) {\r\n var results = new Array();\r\n var tempResults = rawResults.results ? rawResults.results : rawResults;\r\n for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {\r\n var tempResult = tempResults_1[_i];\r\n var cells = tempResult.Cells.results ? tempResult.Cells.results : tempResult.Cells;\r\n results.push(cells.reduce(function (res, cell) {\r\n Object.defineProperty(res, cell.Key, {\r\n configurable: false,\r\n enumerable: true,\r\n value: cell.Value,\r\n writable: false,\r\n });\r\n return res;\r\n }, {}));\r\n }\r\n return results;\r\n };\r\n return SearchResults;\r\n}());\r\n/**\r\n * defines the SortDirection enum\r\n */\r\nvar SortDirection;\r\n(function (SortDirection) {\r\n SortDirection[SortDirection[\"Ascending\"] = 0] = \"Ascending\";\r\n SortDirection[SortDirection[\"Descending\"] = 1] = \"Descending\";\r\n SortDirection[SortDirection[\"FQLFormula\"] = 2] = \"FQLFormula\";\r\n})(SortDirection || (SortDirection = {}));\r\n/**\r\n * defines the ReorderingRuleMatchType enum\r\n */\r\nvar ReorderingRuleMatchType;\r\n(function (ReorderingRuleMatchType) {\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultContainsKeyword\"] = 0] = \"ResultContainsKeyword\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleContainsKeyword\"] = 1] = \"TitleContainsKeyword\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleMatchesKeyword\"] = 2] = \"TitleMatchesKeyword\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlStartsWith\"] = 3] = \"UrlStartsWith\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlExactlyMatches\"] = 4] = \"UrlExactlyMatches\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ContentTypeIs\"] = 5] = \"ContentTypeIs\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"FileExtensionMatches\"] = 6] = \"FileExtensionMatches\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultHasTag\"] = 7] = \"ResultHasTag\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ManualCondition\"] = 8] = \"ManualCondition\";\r\n})(ReorderingRuleMatchType || (ReorderingRuleMatchType = {}));\r\n/**\r\n * Specifies the type value for the property\r\n */\r\nvar QueryPropertyValueType;\r\n(function (QueryPropertyValueType) {\r\n QueryPropertyValueType[QueryPropertyValueType[\"None\"] = 0] = \"None\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"StringType\"] = 1] = \"StringType\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"Int32Type\"] = 2] = \"Int32Type\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"BooleanType\"] = 3] = \"BooleanType\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"StringArrayType\"] = 4] = \"StringArrayType\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"UnSupportedType\"] = 5] = \"UnSupportedType\";\r\n})(QueryPropertyValueType || (QueryPropertyValueType = {}));\r\nvar SearchBuiltInSourceId = /** @class */ (function () {\r\n function SearchBuiltInSourceId() {\r\n }\r\n SearchBuiltInSourceId.Documents = \"e7ec8cee-ded8-43c9-beb5-436b54b31e84\";\r\n SearchBuiltInSourceId.ItemsMatchingContentType = \"5dc9f503-801e-4ced-8a2c-5d1237132419\";\r\n SearchBuiltInSourceId.ItemsMatchingTag = \"e1327b9c-2b8c-4b23-99c9-3730cb29c3f7\";\r\n SearchBuiltInSourceId.ItemsRelatedToCurrentUser = \"48fec42e-4a92-48ce-8363-c2703a40e67d\";\r\n SearchBuiltInSourceId.ItemsWithSameKeywordAsThisItem = \"5c069288-1d17-454a-8ac6-9c642a065f48\";\r\n SearchBuiltInSourceId.LocalPeopleResults = \"b09a7990-05ea-4af9-81ef-edfab16c4e31\";\r\n SearchBuiltInSourceId.LocalReportsAndDataResults = \"203fba36-2763-4060-9931-911ac8c0583b\";\r\n SearchBuiltInSourceId.LocalSharePointResults = \"8413cd39-2156-4e00-b54d-11efd9abdb89\";\r\n SearchBuiltInSourceId.LocalVideoResults = \"78b793ce-7956-4669-aa3b-451fc5defebf\";\r\n SearchBuiltInSourceId.Pages = \"5e34578e-4d08-4edc-8bf3-002acf3cdbcc\";\r\n SearchBuiltInSourceId.Pictures = \"38403c8c-3975-41a8-826e-717f2d41568a\";\r\n SearchBuiltInSourceId.Popular = \"97c71db1-58ce-4891-8b64-585bc2326c12\";\r\n SearchBuiltInSourceId.RecentlyChangedItems = \"ba63bbae-fa9c-42c0-b027-9a878f16557c\";\r\n SearchBuiltInSourceId.RecommendedItems = \"ec675252-14fa-4fbe-84dd-8d098ed74181\";\r\n SearchBuiltInSourceId.Wiki = \"9479bf85-e257-4318-b5a8-81a180f5faa1\";\r\n return SearchBuiltInSourceId;\r\n}());\n\nvar SearchSuggest = /** @class */ (function (_super) {\r\n __extends(SearchSuggest, _super);\r\n function SearchSuggest() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SearchSuggest.prototype.execute = function (query) {\r\n this.mapQueryToQueryString(query);\r\n return this.get().then(function (response) {\r\n var mapper = hOP(response, \"suggest\") ? function (s) { return response.suggest[s].results; } : function (s) { return response[s]; };\r\n return {\r\n PeopleNames: mapper(\"PeopleNames\"),\r\n PersonalResults: mapper(\"PersonalResults\"),\r\n Queries: mapper(\"Queries\"),\r\n };\r\n });\r\n };\r\n SearchSuggest.prototype.mapQueryToQueryString = function (query) {\r\n var _this = this;\r\n var setProp = function (q) { return function (checkProp) { return function (sp) {\r\n if (hOP(q, checkProp)) {\r\n _this.query.set(sp, q[checkProp].toString());\r\n }\r\n }; }; };\r\n this.query.set(\"querytext\", \"'\" + query.querytext + \"'\");\r\n var querySetter = setProp(query);\r\n querySetter(\"count\")(\"inumberofquerysuggestions\");\r\n querySetter(\"personalCount\")(\"inumberofresultsuggestions\");\r\n querySetter(\"preQuery\")(\"fprequerysuggestions\");\r\n querySetter(\"hitHighlighting\")(\"fhithighlighting\");\r\n querySetter(\"capitalize\")(\"fcapitalizefirstletters\");\r\n querySetter(\"culture\")(\"culture\");\r\n querySetter(\"stemming\")(\"enablestemming\");\r\n querySetter(\"includePeople\")(\"showpeoplenamesuggestions\");\r\n querySetter(\"queryRules\")(\"enablequeryrules\");\r\n querySetter(\"prefixMatch\")(\"fprefixmatchallterms\");\r\n };\r\n SearchSuggest = __decorate([\r\n defaultPath(\"_api/search/suggest\")\r\n ], SearchSuggest);\r\n return SearchSuggest;\r\n}(SharePointQueryableInstance));\n\n/**\r\n * Describes a collection of List objects\r\n *\r\n */\r\nvar Features = /** @class */ (function (_super) {\r\n __extends(Features, _super);\r\n function Features() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Features_1 = Features;\r\n /**\r\n * Adds a new list to the collection\r\n *\r\n * @param id The Id of the feature (GUID)\r\n * @param force If true the feature activation will be forced\r\n */\r\n Features.prototype.add = function (id, force) {\r\n var _this = this;\r\n if (force === void 0) { force = false; }\r\n return this.clone(Features_1, \"add\").postCore({\r\n body: jsS({\r\n featdefScope: 0,\r\n featureId: id,\r\n force: force,\r\n }),\r\n }).then(function (data) {\r\n return {\r\n data: data,\r\n feature: _this.getById(id),\r\n };\r\n });\r\n };\r\n /**\r\n * Gets a list from the collection by guid id\r\n *\r\n * @param id The Id of the feature (GUID)\r\n */\r\n Features.prototype.getById = function (id) {\r\n var feature = new Feature(this);\r\n feature.concat(\"('\" + id + \"')\");\r\n return feature;\r\n };\r\n /**\r\n * Removes (deactivates) a feature from the collection\r\n *\r\n * @param id The Id of the feature (GUID)\r\n * @param force If true the feature deactivation will be forced\r\n */\r\n Features.prototype.remove = function (id, force) {\r\n if (force === void 0) { force = false; }\r\n return this.clone(Features_1, \"remove\").postCore({\r\n body: jsS({\r\n featureId: id,\r\n force: force,\r\n }),\r\n });\r\n };\r\n var Features_1;\r\n Features = Features_1 = __decorate([\r\n defaultPath(\"features\")\r\n ], Features);\r\n return Features;\r\n}(SharePointQueryableCollection));\r\nvar Feature = /** @class */ (function (_super) {\r\n __extends(Feature, _super);\r\n function Feature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Removes (deactivates) a feature from the collection\r\n *\r\n * @param force If true the feature deactivation will be forced\r\n */\r\n Feature.prototype.deactivate = function (force) {\r\n var _this = this;\r\n if (force === void 0) { force = false; }\r\n var removeDependency = this.addBatchDependency();\r\n var idGet = new Feature(this).select(\"DefinitionId\");\r\n return idGet.get().then(function (feature) {\r\n var promise = _this.getParent(Features, _this.parentUrl, \"\", _this.batch).remove(feature.DefinitionId, force);\r\n removeDependency();\r\n return promise;\r\n });\r\n };\r\n return Feature;\r\n}(SharePointQueryableInstance));\n\nvar RelatedItemManagerImpl = /** @class */ (function (_super) {\r\n __extends(RelatedItemManagerImpl, _super);\r\n function RelatedItemManagerImpl() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RelatedItemManagerImpl_1 = RelatedItemManagerImpl;\r\n RelatedItemManagerImpl.FromUrl = function (url) {\r\n if (url === null) {\r\n return new RelatedItemManagerImpl_1(\"\");\r\n }\r\n var index = url.indexOf(\"_api/\");\r\n if (index > -1) {\r\n return new RelatedItemManagerImpl_1(url.substr(0, index));\r\n }\r\n return new RelatedItemManagerImpl_1(url);\r\n };\r\n RelatedItemManagerImpl.prototype.getRelatedItems = function (sourceListName, sourceItemId) {\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".GetRelatedItems\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n }),\r\n });\r\n };\r\n RelatedItemManagerImpl.prototype.getPageOneRelatedItems = function (sourceListName, sourceItemId) {\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".GetPageOneRelatedItems\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n }),\r\n });\r\n };\r\n RelatedItemManagerImpl.prototype.addSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemID, targetWebUrl, tryAddReverseLink) {\r\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".AddSingleLink\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n SourceWebUrl: sourceWebUrl,\r\n TargetItemID: targetItemID,\r\n TargetListName: targetListName,\r\n TargetWebUrl: targetWebUrl,\r\n TryAddReverseLink: tryAddReverseLink,\r\n }),\r\n });\r\n };\r\n /**\r\n * Adds a related item link from an item specified by list name and item id, to an item specified by url\r\n *\r\n * @param sourceListName The source list name or list id\r\n * @param sourceItemId The source item id\r\n * @param targetItemUrl The target item url\r\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\r\n */\r\n RelatedItemManagerImpl.prototype.addSingleLinkToUrl = function (sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink) {\r\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".AddSingleLinkToUrl\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n TargetItemUrl: targetItemUrl,\r\n TryAddReverseLink: tryAddReverseLink,\r\n }),\r\n });\r\n };\r\n /**\r\n * Adds a related item link from an item specified by url, to an item specified by list name and item id\r\n *\r\n * @param sourceItemUrl The source item url\r\n * @param targetListName The target list name or list id\r\n * @param targetItemId The target item id\r\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\r\n */\r\n RelatedItemManagerImpl.prototype.addSingleLinkFromUrl = function (sourceItemUrl, targetListName, targetItemId, tryAddReverseLink) {\r\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".AddSingleLinkFromUrl\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemUrl: sourceItemUrl,\r\n TargetItemID: targetItemId,\r\n TargetListName: targetListName,\r\n TryAddReverseLink: tryAddReverseLink,\r\n }),\r\n });\r\n };\r\n RelatedItemManagerImpl.prototype.deleteSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemId, targetWebUrl, tryDeleteReverseLink) {\r\n if (tryDeleteReverseLink === void 0) { tryDeleteReverseLink = false; }\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".DeleteSingleLink\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n SourceWebUrl: sourceWebUrl,\r\n TargetItemID: targetItemId,\r\n TargetListName: targetListName,\r\n TargetWebUrl: targetWebUrl,\r\n TryDeleteReverseLink: tryDeleteReverseLink,\r\n }),\r\n });\r\n };\r\n var RelatedItemManagerImpl_1;\r\n RelatedItemManagerImpl = RelatedItemManagerImpl_1 = __decorate([\r\n defaultPath(\"_api/SP.RelatedItemManager\")\r\n ], RelatedItemManagerImpl);\r\n return RelatedItemManagerImpl;\r\n}(SharePointQueryable));\n\n/**\r\n * Describes a collection of webs\r\n *\r\n */\r\nvar Webs = /** @class */ (function (_super) {\r\n __extends(Webs, _super);\r\n function Webs() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Webs_1 = Webs;\r\n /**\r\n * Adds a new web to the collection\r\n *\r\n * @param title The new web's title\r\n * @param url The new web's relative url\r\n * @param description The new web's description\r\n * @param template The new web's template internal name (default = STS)\r\n * @param language The locale id that specifies the new web's language (default = 1033 [English, US])\r\n * @param inheritPermissions When true, permissions will be inherited from the new web's parent (default = true)\r\n */\r\n Webs.prototype.add = function (title, url, description, template, language, inheritPermissions) {\r\n if (description === void 0) { description = \"\"; }\r\n if (template === void 0) { template = \"STS\"; }\r\n if (language === void 0) { language = 1033; }\r\n if (inheritPermissions === void 0) { inheritPermissions = true; }\r\n var props = {\r\n Description: description,\r\n Language: language,\r\n Title: title,\r\n Url: url,\r\n UseSamePermissionsAsParentSite: inheritPermissions,\r\n WebTemplate: template,\r\n };\r\n var postBody = jsS({\r\n \"parameters\": extend({\r\n \"__metadata\": { \"type\": \"SP.WebCreationInformation\" },\r\n }, props),\r\n });\r\n return this.clone(Webs_1, \"add\").postCore({ body: postBody }).then(function (data) {\r\n return {\r\n data: data,\r\n web: new Web(odataUrlFrom(data).replace(/_api\\/web\\/?/i, \"\")),\r\n };\r\n });\r\n };\r\n var Webs_1;\r\n Webs = Webs_1 = __decorate([\r\n defaultPath(\"webs\")\r\n ], Webs);\r\n return Webs;\r\n}(SharePointQueryableCollection));\r\n/**\r\n * Describes a collection of web infos\r\n *\r\n */\r\nvar WebInfos = /** @class */ (function (_super) {\r\n __extends(WebInfos, _super);\r\n function WebInfos() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n WebInfos = __decorate([\r\n defaultPath(\"webinfos\")\r\n ], WebInfos);\r\n return WebInfos;\r\n}(SharePointQueryableCollection));\r\n/**\r\n * Describes a web\r\n *\r\n */\r\nvar Web = /** @class */ (function (_super) {\r\n __extends(Web, _super);\r\n function Web() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Web_1 = Web;\r\n /**\r\n * Creates a new web instance from the given url by indexing the location of the /_api/\r\n * segment. If this is not found the method creates a new web with the entire string as\r\n * supplied.\r\n *\r\n * @param url\r\n */\r\n Web.fromUrl = function (url, path) {\r\n return new Web_1(extractWebUrl(url), path);\r\n };\r\n Object.defineProperty(Web.prototype, \"webs\", {\r\n /**\r\n * Gets this web's subwebs\r\n *\r\n */\r\n get: function () {\r\n return new Webs(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets this web's parent web and data\r\n *\r\n */\r\n Web.prototype.getParentWeb = function () {\r\n var _this = this;\r\n return this.select(\"ParentWeb/Id\").expand(\"ParentWeb\").get()\r\n .then(function (_a) {\r\n var ParentWeb = _a.ParentWeb;\r\n return new Site(_this.toUrlAndQuery().split(\"/_api\")[0]).openWebById(ParentWeb.Id);\r\n });\r\n };\r\n /**\r\n * Returns a collection of objects that contain metadata about subsites of the current site in which the current user is a member.\r\n *\r\n * @param nWebTemplateFilter Specifies the site definition (default = -1)\r\n * @param nConfigurationFilter A 16-bit integer that specifies the identifier of a configuration (default = -1)\r\n */\r\n Web.prototype.getSubwebsFilteredForCurrentUser = function (nWebTemplateFilter, nConfigurationFilter) {\r\n if (nWebTemplateFilter === void 0) { nWebTemplateFilter = -1; }\r\n if (nConfigurationFilter === void 0) { nConfigurationFilter = -1; }\r\n return this.clone(Webs, \"getSubwebsFilteredForCurrentUser(nWebTemplateFilter=\" + nWebTemplateFilter + \",nConfigurationFilter=\" + nConfigurationFilter + \")\");\r\n };\r\n Object.defineProperty(Web.prototype, \"allProperties\", {\r\n /**\r\n * Allows access to the web's all properties collection\r\n */\r\n get: function () {\r\n return this.clone(SharePointQueryableCollection, \"allproperties\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"webinfos\", {\r\n /**\r\n * Gets a collection of WebInfos for this web's subwebs\r\n *\r\n */\r\n get: function () {\r\n return new WebInfos(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"contentTypes\", {\r\n /**\r\n * Gets the content types available in this web\r\n *\r\n */\r\n get: function () {\r\n return new ContentTypes(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"lists\", {\r\n /**\r\n * Gets the lists in this web\r\n *\r\n */\r\n get: function () {\r\n return new Lists(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"fields\", {\r\n /**\r\n * Gets the fields in this web\r\n *\r\n */\r\n get: function () {\r\n return new Fields(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"features\", {\r\n /**\r\n * Gets the active features for this web\r\n *\r\n */\r\n get: function () {\r\n return new Features(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"availablefields\", {\r\n /**\r\n * Gets the available fields in this web\r\n *\r\n */\r\n get: function () {\r\n return new Fields(this, \"availablefields\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"navigation\", {\r\n /**\r\n * Gets the navigation options in this web\r\n *\r\n */\r\n get: function () {\r\n return new Navigation(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"siteUsers\", {\r\n /**\r\n * Gets the site users\r\n *\r\n */\r\n get: function () {\r\n return new SiteUsers(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"siteGroups\", {\r\n /**\r\n * Gets the site groups\r\n *\r\n */\r\n get: function () {\r\n return new SiteGroups(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"siteUserInfoList\", {\r\n /**\r\n * Gets site user info list\r\n *\r\n */\r\n get: function () {\r\n return new List(this, \"siteuserinfolist\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"regionalSettings\", {\r\n /**\r\n * Gets regional settings\r\n *\r\n */\r\n get: function () {\r\n return new RegionalSettings(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"currentUser\", {\r\n /**\r\n * Gets the current user\r\n */\r\n get: function () {\r\n return new CurrentUser(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"folders\", {\r\n /**\r\n * Gets the top-level folders in this web\r\n *\r\n */\r\n get: function () {\r\n return new Folders(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"userCustomActions\", {\r\n /**\r\n * Gets all user custom actions for this web\r\n *\r\n */\r\n get: function () {\r\n return new UserCustomActions(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"roleDefinitions\", {\r\n /**\r\n * Gets the collection of RoleDefinition resources\r\n *\r\n */\r\n get: function () {\r\n return new RoleDefinitions(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"relatedItems\", {\r\n /**\r\n * Provides an interface to manage related items\r\n *\r\n */\r\n get: function () {\r\n return RelatedItemManagerImpl.FromUrl(this.toUrl());\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a new batch for requests within the context of this web\r\n *\r\n */\r\n Web.prototype.createBatch = function () {\r\n return new SPBatch(this.parentUrl);\r\n };\r\n Object.defineProperty(Web.prototype, \"rootFolder\", {\r\n /**\r\n * Gets the root folder of this web\r\n *\r\n */\r\n get: function () {\r\n return new Folder(this, \"rootFolder\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"associatedOwnerGroup\", {\r\n /**\r\n * Gets the associated owner group for this web\r\n *\r\n */\r\n get: function () {\r\n return new SiteGroup(this, \"associatedownergroup\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"associatedMemberGroup\", {\r\n /**\r\n * Gets the associated member group for this web\r\n *\r\n */\r\n get: function () {\r\n return new SiteGroup(this, \"associatedmembergroup\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"associatedVisitorGroup\", {\r\n /**\r\n * Gets the associated visitor group for this web\r\n *\r\n */\r\n get: function () {\r\n return new SiteGroup(this, \"associatedvisitorgroup\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets a folder by server relative url\r\n *\r\n * @param folderRelativeUrl The server relative path to the folder (including /sites/ if applicable)\r\n */\r\n Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {\r\n return new Folder(this, \"getFolderByServerRelativeUrl('\" + folderRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Gets a folder by server relative relative path if your folder name contains # and % characters\r\n * you need to first encode the file name using encodeURIComponent() and then pass the url\r\n * let url = \"/sites/test/Shared Documents/\" + encodeURIComponent(\"%123\");\r\n * This works only in SharePoint online.\r\n *\r\n * @param folderRelativeUrl The server relative path to the folder (including /sites/ if applicable)\r\n */\r\n Web.prototype.getFolderByServerRelativePath = function (folderRelativeUrl) {\r\n return new Folder(this, \"getFolderByServerRelativePath(decodedUrl='\" + folderRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Gets a file by server relative url\r\n *\r\n * @param fileRelativeUrl The server relative path to the file (including /sites/ if applicable)\r\n */\r\n Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {\r\n return new File(this, \"getFileByServerRelativeUrl('\" + fileRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Gets a file by server relative url if your file name contains # and % characters\r\n * you need to first encode the file name using encodeURIComponent() and then pass the url\r\n * let url = \"/sites/test/Shared Documents/\" + encodeURIComponent(\"%123.docx\");\r\n *\r\n * @param fileRelativeUrl The server relative path to the file (including /sites/ if applicable)\r\n */\r\n Web.prototype.getFileByServerRelativePath = function (fileRelativeUrl) {\r\n return new File(this, \"getFileByServerRelativePath(decodedUrl='\" + fileRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Gets a list by server relative url (list's root folder)\r\n *\r\n * @param listRelativeUrl The server relative path to the list's root folder (including /sites/ if applicable)\r\n */\r\n Web.prototype.getList = function (listRelativeUrl) {\r\n return new List(this, \"getList('\" + listRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Updates this web instance with the supplied properties\r\n *\r\n * @param properties A plain object hash of values to update for the web\r\n */\r\n Web.prototype.update = function (properties) {\r\n var _this = this;\r\n var postBody = jsS(extend({\r\n \"__metadata\": { \"type\": \"SP.Web\" },\r\n }, properties));\r\n return this.postCore({\r\n body: postBody,\r\n headers: {\r\n \"X-HTTP-Method\": \"MERGE\",\r\n },\r\n }).then(function (data) {\r\n return {\r\n data: data,\r\n web: _this,\r\n };\r\n });\r\n };\r\n /**\r\n * Deletes this web\r\n *\r\n */\r\n Web.prototype.delete = function () {\r\n return _super.prototype.deleteCore.call(this);\r\n };\r\n /**\r\n * Applies the theme specified by the contents of each of the files specified in the arguments to the site\r\n *\r\n * @param colorPaletteUrl The server-relative URL of the color palette file\r\n * @param fontSchemeUrl The server-relative URL of the font scheme\r\n * @param backgroundImageUrl The server-relative URL of the background image\r\n * @param shareGenerated When true, the generated theme files are stored in the root site. When false, they are stored in this web\r\n */\r\n Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {\r\n var postBody = jsS({\r\n backgroundImageUrl: backgroundImageUrl,\r\n colorPaletteUrl: colorPaletteUrl,\r\n fontSchemeUrl: fontSchemeUrl,\r\n shareGenerated: shareGenerated,\r\n });\r\n return this.clone(Web_1, \"applytheme\").postCore({ body: postBody });\r\n };\r\n /**\r\n * Applies the specified site definition or site template to the Web site that has no template applied to it\r\n *\r\n * @param template Name of the site definition or the name of the site template\r\n */\r\n Web.prototype.applyWebTemplate = function (template) {\r\n var q = this.clone(Web_1, \"applywebtemplate\");\r\n q.concat(\"(@t)\");\r\n q.query.set(\"@t\", template);\r\n return q.postCore();\r\n };\r\n /**\r\n * Checks whether the specified login name belongs to a valid user in the web. If the user doesn't exist, adds the user to the web.\r\n *\r\n * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com)\r\n */\r\n Web.prototype.ensureUser = function (loginName) {\r\n var postBody = jsS({\r\n logonName: loginName,\r\n });\r\n return this.clone(Web_1, \"ensureuser\").postCore({ body: postBody }).then(function (data) {\r\n return {\r\n data: data,\r\n user: new SiteUser(odataUrlFrom(data)),\r\n };\r\n });\r\n };\r\n /**\r\n * Returns a collection of site templates available for the site\r\n *\r\n * @param language The locale id of the site templates to retrieve (default = 1033 [English, US])\r\n * @param includeCrossLanguage When true, includes language-neutral site templates; otherwise false (default = true)\r\n */\r\n Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {\r\n if (language === void 0) { language = 1033; }\r\n if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }\r\n return new SharePointQueryableCollection(this, \"getavailablewebtemplates(lcid=\" + language + \", doincludecrosslanguage=\" + includeCrossLanugage + \")\");\r\n };\r\n /**\r\n * Returns the list gallery on the site\r\n *\r\n * @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114,\r\n * MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125\r\n */\r\n Web.prototype.getCatalog = function (type) {\r\n return this.clone(Web_1, \"getcatalog(\" + type + \")\").select(\"Id\").get().then(function (data) {\r\n return new List(odataUrlFrom(data));\r\n });\r\n };\r\n /**\r\n * Returns the collection of changes from the change log that have occurred within the list, based on the specified query\r\n *\r\n * @param query The change query\r\n */\r\n Web.prototype.getChanges = function (query) {\r\n var postBody = jsS({ \"query\": extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\r\n return this.clone(Web_1, \"getchanges\").postCore({ body: postBody });\r\n };\r\n Object.defineProperty(Web.prototype, \"customListTemplate\", {\r\n /**\r\n * Gets the custom list templates for the site\r\n *\r\n */\r\n get: function () {\r\n return new SharePointQueryableCollection(this, \"getcustomlisttemplates\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the user corresponding to the specified member identifier for the current site\r\n *\r\n * @param id The id of the user\r\n */\r\n Web.prototype.getUserById = function (id) {\r\n return new SiteUser(this, \"getUserById(\" + id + \")\");\r\n };\r\n /**\r\n * Returns the name of the image file for the icon that is used to represent the specified file\r\n *\r\n * @param filename The file name. If this parameter is empty, the server returns an empty string\r\n * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1 (default = 0)\r\n * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName\r\n */\r\n Web.prototype.mapToIcon = function (filename, size, progId) {\r\n if (size === void 0) { size = 0; }\r\n if (progId === void 0) { progId = \"\"; }\r\n return this.clone(Web_1, \"maptoicon(filename='\" + filename + \"', progid='\" + progId + \"', size=\" + size + \")\").get();\r\n };\r\n /**\r\n * Returns the tenant property corresponding to the specified key in the app catalog site\r\n *\r\n * @param key Id of storage entity to be set\r\n */\r\n Web.prototype.getStorageEntity = function (key) {\r\n return this.clone(Web_1, \"getStorageEntity('\" + key + \"')\").get();\r\n };\r\n /**\r\n * This will set the storage entity identified by the given key (MUST be called in the context of the app catalog)\r\n *\r\n * @param key Id of storage entity to be set\r\n * @param value Value of storage entity to be set\r\n * @param description Description of storage entity to be set\r\n * @param comments Comments of storage entity to be set\r\n */\r\n Web.prototype.setStorageEntity = function (key, value, description, comments) {\r\n if (description === void 0) { description = \"\"; }\r\n if (comments === void 0) { comments = \"\"; }\r\n return this.clone(Web_1, \"setStorageEntity\").postCore({\r\n body: jsS({\r\n comments: comments,\r\n description: description,\r\n key: key,\r\n value: value,\r\n }),\r\n });\r\n };\r\n /**\r\n * This will remove the storage entity identified by the given key\r\n *\r\n * @param key Id of storage entity to be removed\r\n */\r\n Web.prototype.removeStorageEntity = function (key) {\r\n return this.clone(Web_1, \"removeStorageEntity('\" + key + \"')\").postCore();\r\n };\r\n /**\r\n * Gets the app catalog for this web\r\n *\r\n * @param url Optional url or web containing the app catalog (default: current web)\r\n */\r\n Web.prototype.getAppCatalog = function (url) {\r\n return new AppCatalog(url || this);\r\n };\r\n /**\r\n * Gets the collection of available client side web parts for this web instance\r\n */\r\n Web.prototype.getClientSideWebParts = function () {\r\n return this.clone(SharePointQueryableCollection, \"GetClientSideWebParts\").get();\r\n };\r\n /**\r\n * Creates a new client side page\r\n *\r\n * @param pageName Name of the new page\r\n * @param title Display title of the new page\r\n * @param libraryTitle Title of the library in which to create the new page. Default: \"Site Pages\"\r\n */\r\n Web.prototype.addClientSidePage = function (pageName, title, libraryTitle) {\r\n if (title === void 0) { title = pageName.replace(/\\.[^/.]+$/, \"\"); }\r\n if (libraryTitle === void 0) { libraryTitle = \"Site Pages\"; }\r\n return ClientSidePage.create(this.lists.getByTitle(libraryTitle), pageName, title);\r\n };\r\n /**\r\n * Creates a new client side page using the library path\r\n *\r\n * @param pageName Name of the new page\r\n * @param listRelativePath The server relative path to the list's root folder (including /sites/ if applicable)\r\n * @param title Display title of the new page\r\n */\r\n Web.prototype.addClientSidePageByPath = function (pageName, listRelativePath, title) {\r\n if (title === void 0) { title = pageName.replace(/\\.[^/.]+$/, \"\"); }\r\n return ClientSidePage.create(this.getList(listRelativePath), pageName, title);\r\n };\r\n var Web_1;\r\n Web = Web_1 = __decorate([\r\n defaultPath(\"_api/web\")\r\n ], Web);\r\n return Web;\r\n}(SharePointQueryableShareableWeb));\n\n/**\r\n * Describes a site collection\r\n *\r\n */\r\nvar Site = /** @class */ (function (_super) {\r\n __extends(Site, _super);\r\n function Site() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Site_1 = Site;\r\n Object.defineProperty(Site.prototype, \"rootWeb\", {\r\n /**\r\n * Gets the root web of the site collection\r\n *\r\n */\r\n get: function () {\r\n return new Web(this, \"rootweb\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Site.prototype, \"features\", {\r\n /**\r\n * Gets the active features for this site collection\r\n *\r\n */\r\n get: function () {\r\n return new Features(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Site.prototype, \"userCustomActions\", {\r\n /**\r\n * Gets all custom actions for this site collection\r\n *\r\n */\r\n get: function () {\r\n return new UserCustomActions(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets a Web instance representing the root web of the site collection\r\n * correctly setup for chaining within the library\r\n */\r\n Site.prototype.getRootWeb = function () {\r\n return this.rootWeb.select(\"Url\").get().then(function (web) { return new Web(web.Url); });\r\n };\r\n /**\r\n * Gets the context information for this site collection\r\n */\r\n Site.prototype.getContextInfo = function () {\r\n var q = new Site_1(this.parentUrl, \"_api/contextinfo\");\r\n return q.postCore().then(function (data) {\r\n if (hOP(data, \"GetContextWebInformation\")) {\r\n var info = data.GetContextWebInformation;\r\n info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;\r\n return info;\r\n }\r\n else {\r\n return data;\r\n }\r\n });\r\n };\r\n /**\r\n * Gets the document libraries on a site. Static method. (SharePoint Online only)\r\n *\r\n * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned\r\n */\r\n Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {\r\n var q = new SharePointQueryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\r\n q.query.set(\"@v\", \"'\" + absoluteWebUrl + \"'\");\r\n return q.get().then(function (data) {\r\n if (hOP(data, \"GetDocumentLibraries\")) {\r\n return data.GetDocumentLibraries;\r\n }\r\n else {\r\n return data;\r\n }\r\n });\r\n };\r\n /**\r\n * Gets the site url from a page url\r\n *\r\n * @param absolutePageUrl The absolute url of the page\r\n */\r\n Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {\r\n var q = new SharePointQueryable(\"\", \"_api/sp.web.getweburlfrompageurl(@v)\");\r\n q.query.set(\"@v\", \"'\" + absolutePageUrl + \"'\");\r\n return q.get().then(function (data) {\r\n if (hOP(data, \"GetWebUrlFromPageUrl\")) {\r\n return data.GetWebUrlFromPageUrl;\r\n }\r\n else {\r\n return data;\r\n }\r\n });\r\n };\r\n /**\r\n * Creates a new batch for requests within the context of this site collection\r\n *\r\n */\r\n Site.prototype.createBatch = function () {\r\n return new SPBatch(this.parentUrl);\r\n };\r\n /**\r\n * Opens a web by id (using POST)\r\n *\r\n * @param webId The GUID id of the web to open\r\n */\r\n Site.prototype.openWebById = function (webId) {\r\n return this.clone(Site_1, \"openWebById('\" + webId + \"')\").postCore().then(function (d) { return ({\r\n data: d,\r\n web: Web.fromUrl(d[\"odata.id\"] || d.__metadata.uri),\r\n }); });\r\n };\r\n var Site_1;\r\n Site = Site_1 = __decorate([\r\n defaultPath(\"_api/site\")\r\n ], Site);\r\n return Site;\r\n}(SharePointQueryableInstance));\n\nvar UserProfileQuery = /** @class */ (function (_super) {\r\n __extends(UserProfileQuery, _super);\r\n /**\r\n * Creates a new instance of the UserProfileQuery class\r\n *\r\n * @param baseUrl The url or SharePointQueryable which forms the parent of this user profile query\r\n */\r\n function UserProfileQuery(baseUrl, path) {\r\n if (path === void 0) { path = \"_api/sp.userprofiles.peoplemanager\"; }\r\n var _this = _super.call(this, baseUrl, path) || this;\r\n _this.clientPeoplePickerQuery = (new ClientPeoplePickerQuery(baseUrl)).configureFrom(_this);\r\n _this.profileLoader = (new ProfileLoader(baseUrl)).configureFrom(_this);\r\n return _this;\r\n }\r\n Object.defineProperty(UserProfileQuery.prototype, \"editProfileLink\", {\r\n /**\r\n * The url of the edit profile page for the current user\r\n */\r\n get: function () {\r\n return this.clone(UserProfileQuery, \"EditProfileLink\").get();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(UserProfileQuery.prototype, \"isMyPeopleListPublic\", {\r\n /**\r\n * A boolean value that indicates whether the current user's \"People I'm Following\" list is public\r\n */\r\n get: function () {\r\n return this.clone(UserProfileQuery, \"IsMyPeopleListPublic\").get();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * A boolean value that indicates whether the current user is being followed by the specified user\r\n *\r\n * @param loginName The account name of the user\r\n */\r\n UserProfileQuery.prototype.amIFollowedBy = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"amifollowedby(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * A boolean value that indicates whether the current user is following the specified user\r\n *\r\n * @param loginName The account name of the user\r\n */\r\n UserProfileQuery.prototype.amIFollowing = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"amifollowing(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * Gets tags that the current user is following\r\n *\r\n * @param maxCount The maximum number of tags to retrieve (default is 20)\r\n */\r\n UserProfileQuery.prototype.getFollowedTags = function (maxCount) {\r\n if (maxCount === void 0) { maxCount = 20; }\r\n return this.clone(UserProfileQuery, \"getfollowedtags(\" + maxCount + \")\").get();\r\n };\r\n /**\r\n * Gets the people who are following the specified user\r\n *\r\n * @param loginName The account name of the user\r\n */\r\n UserProfileQuery.prototype.getFollowersFor = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"getfollowersfor(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n Object.defineProperty(UserProfileQuery.prototype, \"myFollowers\", {\r\n /**\r\n * Gets the people who are following the current user\r\n *\r\n */\r\n get: function () {\r\n return new SharePointQueryableCollection(this, \"getmyfollowers\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(UserProfileQuery.prototype, \"myProperties\", {\r\n /**\r\n * Gets user properties for the current user\r\n *\r\n */\r\n get: function () {\r\n return new UserProfileQuery(this, \"getmyproperties\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets the people who the specified user is following\r\n *\r\n * @param loginName The account name of the user.\r\n */\r\n UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"getpeoplefollowedby(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * Gets user properties for the specified user.\r\n *\r\n * @param loginName The account name of the user.\r\n */\r\n UserProfileQuery.prototype.getPropertiesFor = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"getpropertiesfor(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n Object.defineProperty(UserProfileQuery.prototype, \"trendingTags\", {\r\n /**\r\n * Gets the 20 most popular hash tags over the past week, sorted so that the most popular tag appears first\r\n *\r\n */\r\n get: function () {\r\n var q = this.clone(UserProfileQuery, null);\r\n q.concat(\".gettrendingtags\");\r\n return q.get();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets the specified user profile property for the specified user\r\n *\r\n * @param loginName The account name of the user\r\n * @param propertyName The case-sensitive name of the property to get\r\n */\r\n UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {\r\n var q = this.clone(UserProfileQuery, \"getuserprofilepropertyfor(accountname=@v, propertyname='\" + propertyName + \"')\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * Removes the specified user from the user's list of suggested people to follow\r\n *\r\n * @param loginName The account name of the user\r\n */\r\n UserProfileQuery.prototype.hideSuggestion = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"hidesuggestion(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.postCore();\r\n };\r\n /**\r\n * A boolean values that indicates whether the first user is following the second user\r\n *\r\n * @param follower The account name of the user who might be following the followee\r\n * @param followee The account name of the user who might be followed by the follower\r\n */\r\n UserProfileQuery.prototype.isFollowing = function (follower, followee) {\r\n var q = this.clone(UserProfileQuery, null);\r\n q.concat(\".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(follower) + \"'\");\r\n q.query.set(\"@y\", \"'\" + encodeURIComponent(followee) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * Uploads and sets the user profile picture (Users can upload a picture to their own profile only). Not supported for batching.\r\n *\r\n * @param profilePicSource Blob data representing the user's picture in BMP, JPEG, or PNG format of up to 4.76MB\r\n */\r\n UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n var buffer = null;\r\n var reader = new FileReader();\r\n reader.onload = function (e) { return buffer = e.target.result; };\r\n reader.readAsArrayBuffer(profilePicSource);\r\n var request = new UserProfileQuery(_this, \"setmyprofilepicture\");\r\n request.postCore({\r\n body: String.fromCharCode.apply(null, new Uint16Array(buffer)),\r\n }).then(function (_) { return resolve(); }).catch(function (e) { return reject(e); });\r\n });\r\n };\r\n /**\r\n * Sets single value User Profile property\r\n *\r\n * @param accountName The account name of the user\r\n * @param propertyName Property name\r\n * @param propertyValue Property value\r\n */\r\n UserProfileQuery.prototype.setSingleValueProfileProperty = function (accountName, propertyName, propertyValue) {\r\n var postBody = jsS({\r\n accountName: accountName,\r\n propertyName: propertyName,\r\n propertyValue: propertyValue,\r\n });\r\n return this.clone(UserProfileQuery, \"SetSingleValueProfileProperty\")\r\n .postCore({ body: postBody });\r\n };\r\n /**\r\n * Sets multi valued User Profile property\r\n *\r\n * @param accountName The account name of the user\r\n * @param propertyName Property name\r\n * @param propertyValues Property values\r\n */\r\n UserProfileQuery.prototype.setMultiValuedProfileProperty = function (accountName, propertyName, propertyValues) {\r\n var postBody = jsS({\r\n accountName: accountName,\r\n propertyName: propertyName,\r\n propertyValues: propertyValues,\r\n });\r\n return this.clone(UserProfileQuery, \"SetMultiValuedProfileProperty\")\r\n .postCore({ body: postBody });\r\n };\r\n /**\r\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)\r\n *\r\n * @param emails The email addresses of the users to provision sites for\r\n */\r\n UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {\r\n var emails = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n emails[_i] = arguments[_i];\r\n }\r\n return this.profileLoader.createPersonalSiteEnqueueBulk(emails);\r\n };\r\n Object.defineProperty(UserProfileQuery.prototype, \"ownerUserProfile\", {\r\n /**\r\n * Gets the user profile of the site owner\r\n *\r\n */\r\n get: function () {\r\n return this.profileLoader.ownerUserProfile;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(UserProfileQuery.prototype, \"userProfile\", {\r\n /**\r\n * Gets the user profile for the current user\r\n */\r\n get: function () {\r\n return this.profileLoader.userProfile;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files\r\n *\r\n * @param interactiveRequest true if interactively (web) initiated request, or false (default) if non-interactively (client) initiated request\r\n */\r\n UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {\r\n if (interactiveRequest === void 0) { interactiveRequest = false; }\r\n return this.profileLoader.createPersonalSite(interactiveRequest);\r\n };\r\n /**\r\n * Sets the privacy settings for this profile\r\n *\r\n * @param share true to make all social data public; false to make all social data private\r\n */\r\n UserProfileQuery.prototype.shareAllSocialData = function (share) {\r\n return this.profileLoader.shareAllSocialData(share);\r\n };\r\n /**\r\n * Resolves user or group using specified query parameters\r\n *\r\n * @param queryParams The query parameters used to perform resolve\r\n */\r\n UserProfileQuery.prototype.clientPeoplePickerResolveUser = function (queryParams) {\r\n return this.clientPeoplePickerQuery.clientPeoplePickerResolveUser(queryParams);\r\n };\r\n /**\r\n * Searches for users or groups using specified query parameters\r\n *\r\n * @param queryParams The query parameters used to perform search\r\n */\r\n UserProfileQuery.prototype.clientPeoplePickerSearchUser = function (queryParams) {\r\n return this.clientPeoplePickerQuery.clientPeoplePickerSearchUser(queryParams);\r\n };\r\n return UserProfileQuery;\r\n}(SharePointQueryableInstance));\r\nvar ProfileLoader = /** @class */ (function (_super) {\r\n __extends(ProfileLoader, _super);\r\n function ProfileLoader() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ProfileLoader_1 = ProfileLoader;\r\n /**\r\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only) Doesn't support batching\r\n *\r\n * @param emails The email addresses of the users to provision sites for\r\n */\r\n ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {\r\n return this.clone(ProfileLoader_1, \"createpersonalsiteenqueuebulk\", false).postCore({\r\n body: jsS({ \"emailIDs\": emails }),\r\n });\r\n };\r\n Object.defineProperty(ProfileLoader.prototype, \"ownerUserProfile\", {\r\n /**\r\n * Gets the user profile of the site owner.\r\n *\r\n */\r\n get: function () {\r\n var q = this.getParent(ProfileLoader_1, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\r\n if (this.hasBatch) {\r\n q = q.inBatch(this.batch);\r\n }\r\n return q.postCore();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ProfileLoader.prototype, \"userProfile\", {\r\n /**\r\n * Gets the user profile of the current user.\r\n *\r\n */\r\n get: function () {\r\n return this.clone(ProfileLoader_1, \"getuserprofile\").postCore();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.\r\n *\r\n * @param interactiveRequest true if interactively (web) initiated request, or false (default) if non-interactively (client) initiated request\r\n */\r\n ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {\r\n if (interactiveRequest === void 0) { interactiveRequest = false; }\r\n return this.clone(ProfileLoader_1, \"getuserprofile/createpersonalsiteenque(\" + interactiveRequest + \")\").postCore();\r\n };\r\n /**\r\n * Sets the privacy settings for this profile\r\n *\r\n * @param share true to make all social data public; false to make all social data private.\r\n */\r\n ProfileLoader.prototype.shareAllSocialData = function (share) {\r\n return this.clone(ProfileLoader_1, \"getuserprofile/shareallsocialdata(\" + share + \")\").postCore();\r\n };\r\n var ProfileLoader_1;\r\n ProfileLoader = ProfileLoader_1 = __decorate([\r\n defaultPath(\"_api/sp.userprofiles.profileloader.getprofileloader\")\r\n ], ProfileLoader);\r\n return ProfileLoader;\r\n}(SharePointQueryable));\r\nvar ClientPeoplePickerQuery = /** @class */ (function (_super) {\r\n __extends(ClientPeoplePickerQuery, _super);\r\n function ClientPeoplePickerQuery() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ClientPeoplePickerQuery_1 = ClientPeoplePickerQuery;\r\n /**\r\n * Resolves user or group using specified query parameters\r\n *\r\n * @param queryParams The query parameters used to perform resolve\r\n */\r\n ClientPeoplePickerQuery.prototype.clientPeoplePickerResolveUser = function (queryParams) {\r\n var q = this.clone(ClientPeoplePickerQuery_1, null);\r\n q.concat(\".clientpeoplepickerresolveuser\");\r\n return q.postCore({\r\n body: this.createClientPeoplePickerQueryParametersRequestBody(queryParams),\r\n })\r\n .then(function (res) {\r\n if (typeof res === \"object\") {\r\n return res.ClientPeoplePickerResolveUser;\r\n }\r\n return res;\r\n })\r\n .then(JSON.parse);\r\n };\r\n /**\r\n * Searches for users or groups using specified query parameters\r\n *\r\n * @param queryParams The query parameters used to perform search\r\n */\r\n ClientPeoplePickerQuery.prototype.clientPeoplePickerSearchUser = function (queryParams) {\r\n var q = this.clone(ClientPeoplePickerQuery_1, null);\r\n q.concat(\".clientpeoplepickersearchuser\");\r\n return q.postCore({\r\n body: this.createClientPeoplePickerQueryParametersRequestBody(queryParams),\r\n })\r\n .then(function (res) {\r\n if (typeof res === \"object\") {\r\n return res.ClientPeoplePickerSearchUser;\r\n }\r\n return res;\r\n })\r\n .then(JSON.parse);\r\n };\r\n /**\r\n * Creates ClientPeoplePickerQueryParameters request body\r\n *\r\n * @param queryParams The query parameters to create request body\r\n */\r\n ClientPeoplePickerQuery.prototype.createClientPeoplePickerQueryParametersRequestBody = function (queryParams) {\r\n return jsS({\r\n \"queryParams\": extend(metadata(\"SP.UI.ApplicationPages.ClientPeoplePickerQueryParameters\"), queryParams),\r\n });\r\n };\r\n var ClientPeoplePickerQuery_1;\r\n ClientPeoplePickerQuery = ClientPeoplePickerQuery_1 = __decorate([\r\n defaultPath(\"_api/sp.ui.applicationpages.clientpeoplepickerwebserviceinterface\")\r\n ], ClientPeoplePickerQuery);\r\n return ClientPeoplePickerQuery;\r\n}(SharePointQueryable));\n\n/**\r\n * Exposes social following methods\r\n */\r\nvar SocialQuery = /** @class */ (function (_super) {\r\n __extends(SocialQuery, _super);\r\n function SocialQuery() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SocialQuery_1 = SocialQuery;\r\n Object.defineProperty(SocialQuery.prototype, \"my\", {\r\n get: function () {\r\n return new MySocialQuery(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets a URI to a site that lists the current user's followed sites.\r\n */\r\n SocialQuery.prototype.getFollowedSitesUri = function () {\r\n return this.clone(SocialQuery_1, \"FollowedSitesUri\").get().then(function (r) {\r\n return r.FollowedSitesUri || r;\r\n });\r\n };\r\n /**\r\n * Gets a URI to a site that lists the current user's followed documents.\r\n */\r\n SocialQuery.prototype.getFollowedDocumentsUri = function () {\r\n return this.clone(SocialQuery_1, \"FollowedDocumentsUri\").get().then(function (r) {\r\n return r.FollowedDocumentsUri || r;\r\n });\r\n };\r\n /**\r\n * Makes the current user start following a user, document, site, or tag\r\n *\r\n * @param actorInfo The actor to start following\r\n */\r\n SocialQuery.prototype.follow = function (actorInfo) {\r\n return this.clone(SocialQuery_1, \"follow\").postCore({ body: this.createSocialActorInfoRequestBody(actorInfo) });\r\n };\r\n /**\r\n * Indicates whether the current user is following a specified user, document, site, or tag\r\n *\r\n * @param actorInfo The actor to find the following status for\r\n */\r\n SocialQuery.prototype.isFollowed = function (actorInfo) {\r\n return this.clone(SocialQuery_1, \"isfollowed\").postCore({ body: this.createSocialActorInfoRequestBody(actorInfo) });\r\n };\r\n /**\r\n * Makes the current user stop following a user, document, site, or tag\r\n *\r\n * @param actorInfo The actor to stop following\r\n */\r\n SocialQuery.prototype.stopFollowing = function (actorInfo) {\r\n return this.clone(SocialQuery_1, \"stopfollowing\").postCore({ body: this.createSocialActorInfoRequestBody(actorInfo) });\r\n };\r\n /**\r\n * Creates SocialActorInfo request body\r\n *\r\n * @param actorInfo The actor to create request body\r\n */\r\n SocialQuery.prototype.createSocialActorInfoRequestBody = function (actorInfo) {\r\n return jsS({\r\n \"actor\": Object.assign(metadata(\"SP.Social.SocialActorInfo\"), {\r\n Id: null,\r\n }, actorInfo),\r\n });\r\n };\r\n var SocialQuery_1;\r\n SocialQuery = SocialQuery_1 = __decorate([\r\n defaultPath(\"_api/social.following\")\r\n ], SocialQuery);\r\n return SocialQuery;\r\n}(SharePointQueryableInstance));\r\nvar MySocialQuery = /** @class */ (function (_super) {\r\n __extends(MySocialQuery, _super);\r\n function MySocialQuery() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MySocialQuery_1 = MySocialQuery;\r\n /**\r\n * Gets users, documents, sites, and tags that the current user is following.\r\n *\r\n * @param types Bitwise set of SocialActorTypes to retrieve\r\n */\r\n MySocialQuery.prototype.followed = function (types) {\r\n return this.clone(MySocialQuery_1, \"followed(types=\" + types + \")\").get().then(function (r) {\r\n return hOP(r, \"Followed\") ? r.Followed.results : r;\r\n });\r\n };\r\n /**\r\n * Gets the count of users, documents, sites, and tags that the current user is following.\r\n *\r\n * @param types Bitwise set of SocialActorTypes to retrieve\r\n */\r\n MySocialQuery.prototype.followedCount = function (types) {\r\n return this.clone(MySocialQuery_1, \"followedcount(types=\" + types + \")\").get().then(function (r) {\r\n return r.FollowedCount || r;\r\n });\r\n };\r\n /**\r\n * Gets the users who are following the current user.\r\n */\r\n MySocialQuery.prototype.followers = function () {\r\n return this.clone(MySocialQuery_1, \"followers\").get().then(function (r) {\r\n return hOP(r, \"Followers\") ? r.Followers.results : r;\r\n });\r\n };\r\n /**\r\n * Gets users who the current user might want to follow.\r\n */\r\n MySocialQuery.prototype.suggestions = function () {\r\n return this.clone(MySocialQuery_1, \"suggestions\").get().then(function (r) {\r\n return hOP(r, \"Suggestions\") ? r.Suggestions.results : r;\r\n });\r\n };\r\n var MySocialQuery_1;\r\n MySocialQuery = MySocialQuery_1 = __decorate([\r\n defaultPath(\"my\")\r\n ], MySocialQuery);\r\n return MySocialQuery;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Social actor type\r\n *\r\n */\r\nvar SocialActorType;\r\n(function (SocialActorType) {\r\n SocialActorType[SocialActorType[\"User\"] = 0] = \"User\";\r\n SocialActorType[SocialActorType[\"Document\"] = 1] = \"Document\";\r\n SocialActorType[SocialActorType[\"Site\"] = 2] = \"Site\";\r\n SocialActorType[SocialActorType[\"Tag\"] = 3] = \"Tag\";\r\n})(SocialActorType || (SocialActorType = {}));\r\n/**\r\n * Social actor type\r\n *\r\n */\r\n/* tslint:disable:no-bitwise */\r\nvar SocialActorTypes;\r\n(function (SocialActorTypes) {\r\n SocialActorTypes[SocialActorTypes[\"None\"] = 0] = \"None\";\r\n SocialActorTypes[SocialActorTypes[\"User\"] = 1] = \"User\";\r\n SocialActorTypes[SocialActorTypes[\"Document\"] = 2] = \"Document\";\r\n SocialActorTypes[SocialActorTypes[\"Site\"] = 4] = \"Site\";\r\n SocialActorTypes[SocialActorTypes[\"Tag\"] = 8] = \"Tag\";\r\n /**\r\n * The set excludes documents and sites that do not have feeds.\r\n */\r\n SocialActorTypes[SocialActorTypes[\"ExcludeContentWithoutFeeds\"] = 268435456] = \"ExcludeContentWithoutFeeds\";\r\n /**\r\n * The set includes group sites\r\n */\r\n SocialActorTypes[SocialActorTypes[\"IncludeGroupsSites\"] = 536870912] = \"IncludeGroupsSites\";\r\n /**\r\n * The set includes only items created within the last 24 hours\r\n */\r\n SocialActorTypes[SocialActorTypes[\"WithinLast24Hours\"] = 1073741824] = \"WithinLast24Hours\";\r\n})(SocialActorTypes || (SocialActorTypes = {}));\r\n/* tslint:enable */\r\n/**\r\n * Result from following\r\n *\r\n */\r\nvar SocialFollowResult;\r\n(function (SocialFollowResult) {\r\n SocialFollowResult[SocialFollowResult[\"Ok\"] = 0] = \"Ok\";\r\n SocialFollowResult[SocialFollowResult[\"AlreadyFollowing\"] = 1] = \"AlreadyFollowing\";\r\n SocialFollowResult[SocialFollowResult[\"LimitReached\"] = 2] = \"LimitReached\";\r\n SocialFollowResult[SocialFollowResult[\"InternalError\"] = 3] = \"InternalError\";\r\n})(SocialFollowResult || (SocialFollowResult = {}));\r\n/**\r\n * Specifies an exception or status code.\r\n */\r\nvar SocialStatusCode;\r\n(function (SocialStatusCode) {\r\n /**\r\n * The operation completed successfully\r\n */\r\n SocialStatusCode[SocialStatusCode[\"OK\"] = 0] = \"OK\";\r\n /**\r\n * The request is invalid.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"InvalidRequest\"] = 1] = \"InvalidRequest\";\r\n /**\r\n * The current user is not authorized to perform the operation.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"AccessDenied\"] = 2] = \"AccessDenied\";\r\n /**\r\n * The target of the operation was not found.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"ItemNotFound\"] = 3] = \"ItemNotFound\";\r\n /**\r\n * The operation is invalid for the target's current state.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"InvalidOperation\"] = 4] = \"InvalidOperation\";\r\n /**\r\n * The operation completed without modifying the target.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"ItemNotModified\"] = 5] = \"ItemNotModified\";\r\n /**\r\n * The operation failed because an internal error occurred.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"InternalError\"] = 6] = \"InternalError\";\r\n /**\r\n * The operation failed because the server could not access the distributed cache.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"CacheReadError\"] = 7] = \"CacheReadError\";\r\n /**\r\n * The operation succeeded but the server could not update the distributed cache.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"CacheUpdateError\"] = 8] = \"CacheUpdateError\";\r\n /**\r\n * No personal site exists for the current user, and no further information is available.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"PersonalSiteNotFound\"] = 9] = \"PersonalSiteNotFound\";\r\n /**\r\n * No personal site exists for the current user, and a previous attempt to create one failed.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"FailedToCreatePersonalSite\"] = 10] = \"FailedToCreatePersonalSite\";\r\n /**\r\n * No personal site exists for the current user, and a previous attempt to create one was not authorized.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"NotAuthorizedToCreatePersonalSite\"] = 11] = \"NotAuthorizedToCreatePersonalSite\";\r\n /**\r\n * No personal site exists for the current user, and no attempt should be made to create one.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"CannotCreatePersonalSite\"] = 12] = \"CannotCreatePersonalSite\";\r\n /**\r\n * The operation was rejected because an internal limit had been reached.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"LimitReached\"] = 13] = \"LimitReached\";\r\n /**\r\n * The operation failed because an error occurred during the processing of the specified attachment.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"AttachmentError\"] = 14] = \"AttachmentError\";\r\n /**\r\n * The operation succeeded with recoverable errors; the returned data is incomplete.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"PartialData\"] = 15] = \"PartialData\";\r\n /**\r\n * A required SharePoint feature is not enabled.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"FeatureDisabled\"] = 16] = \"FeatureDisabled\";\r\n /**\r\n * The site's storage quota has been exceeded.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"StorageQuotaExceeded\"] = 17] = \"StorageQuotaExceeded\";\r\n /**\r\n * The operation failed because the server could not access the database.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"DatabaseError\"] = 18] = \"DatabaseError\";\r\n})(SocialStatusCode || (SocialStatusCode = {}));\n\n/**\r\n * Allows for calling of the static SP.Utilities.Utility methods by supplying the method name\r\n */\r\nvar UtilityMethod = /** @class */ (function (_super) {\r\n __extends(UtilityMethod, _super);\r\n /**\r\n * Creates a new instance of the Utility method class\r\n *\r\n * @param baseUrl The parent url provider\r\n * @param methodName The static method name to call on the utility class\r\n */\r\n function UtilityMethod(baseUrl, methodName) {\r\n return _super.call(this, UtilityMethod.getBaseUrl(baseUrl), \"_api/SP.Utilities.Utility.\" + methodName) || this;\r\n }\r\n UtilityMethod.getBaseUrl = function (candidate) {\r\n if (typeof candidate === \"string\") {\r\n return candidate;\r\n }\r\n var c = candidate;\r\n var url = c.toUrl();\r\n var index = url.indexOf(\"_api/\");\r\n if (index < 0) {\r\n return url;\r\n }\r\n return url.substr(0, index);\r\n };\r\n UtilityMethod.prototype.excute = function (props) {\r\n return this.postCore({\r\n body: jsS(props),\r\n });\r\n };\r\n /**\r\n * Sends an email based on the supplied properties\r\n *\r\n * @param props The properties of the email to send\r\n */\r\n UtilityMethod.prototype.sendEmail = function (props) {\r\n var params = {\r\n properties: extend(metadata(\"SP.Utilities.EmailProperties\"), {\r\n Body: props.Body,\r\n From: props.From,\r\n Subject: props.Subject,\r\n }),\r\n };\r\n if (props.To && props.To.length > 0) {\r\n params.properties = extend(params.properties, {\r\n To: { results: props.To },\r\n });\r\n }\r\n if (props.CC && props.CC.length > 0) {\r\n params.properties = extend(params.properties, {\r\n CC: { results: props.CC },\r\n });\r\n }\r\n if (props.BCC && props.BCC.length > 0) {\r\n params.properties = extend(params.properties, {\r\n BCC: { results: props.BCC },\r\n });\r\n }\r\n if (props.AdditionalHeaders) {\r\n params.properties = extend(params.properties, {\r\n AdditionalHeaders: props.AdditionalHeaders,\r\n });\r\n }\r\n return this.clone(UtilityMethod, \"SendEmail\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.getCurrentUserEmailAddresses = function () {\r\n return this.clone(UtilityMethod, \"GetCurrentUserEmailAddresses\", true).excute({});\r\n };\r\n UtilityMethod.prototype.resolvePrincipal = function (input, scopes, sources, inputIsEmailOnly, addToUserInfoList, matchUserInfoList) {\r\n if (matchUserInfoList === void 0) { matchUserInfoList = false; }\r\n var params = {\r\n addToUserInfoList: addToUserInfoList,\r\n input: input,\r\n inputIsEmailOnly: inputIsEmailOnly,\r\n matchUserInfoList: matchUserInfoList,\r\n scopes: scopes,\r\n sources: sources,\r\n };\r\n return this.clone(UtilityMethod, \"ResolvePrincipalInCurrentContext\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.searchPrincipals = function (input, scopes, sources, groupName, maxCount) {\r\n var params = {\r\n groupName: groupName,\r\n input: input,\r\n maxCount: maxCount,\r\n scopes: scopes,\r\n sources: sources,\r\n };\r\n return this.clone(UtilityMethod, \"SearchPrincipalsUsingContextWeb\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.createEmailBodyForInvitation = function (pageAddress) {\r\n var params = {\r\n pageAddress: pageAddress,\r\n };\r\n return this.clone(UtilityMethod, \"CreateEmailBodyForInvitation\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.expandGroupsToPrincipals = function (inputs, maxCount) {\r\n if (maxCount === void 0) { maxCount = 30; }\r\n var params = {\r\n inputs: inputs,\r\n maxCount: maxCount,\r\n };\r\n return this.clone(UtilityMethod, \"ExpandGroupsToPrincipals\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.createWikiPage = function (info) {\r\n return this.clone(UtilityMethod, \"CreateWikiPageInContextWeb\", true).excute({\r\n parameters: info,\r\n }).then(function (r) {\r\n return {\r\n data: r,\r\n file: new File(odataUrlFrom(r)),\r\n };\r\n });\r\n };\r\n return UtilityMethod;\r\n}(SharePointQueryable));\n\n/**\r\n * Root of the SharePoint REST module\r\n */\r\nvar SPRest = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the SPRest class\r\n *\r\n * @param options Additional options\r\n * @param baseUrl A string that should form the base part of the url\r\n */\r\n function SPRest(_options, _baseUrl) {\r\n if (_options === void 0) { _options = {}; }\r\n if (_baseUrl === void 0) { _baseUrl = \"\"; }\r\n this._options = _options;\r\n this._baseUrl = _baseUrl;\r\n }\r\n /**\r\n * Configures instance with additional options and baseUrl.\r\n * Provided configuration used by other objects in a chain\r\n *\r\n * @param options Additional options\r\n * @param baseUrl A string that should form the base part of the url\r\n */\r\n SPRest.prototype.configure = function (options, baseUrl) {\r\n if (baseUrl === void 0) { baseUrl = \"\"; }\r\n return new SPRest(options, baseUrl);\r\n };\r\n /**\r\n * Global SharePoint configuration options\r\n *\r\n * @param config The SharePoint configuration to apply\r\n */\r\n SPRest.prototype.setup = function (config) {\r\n setup(config);\r\n };\r\n /**\r\n * Executes a search against this web context\r\n *\r\n * @param query The SearchQuery definition\r\n */\r\n SPRest.prototype.searchSuggest = function (query) {\r\n var finalQuery;\r\n if (typeof query === \"string\") {\r\n finalQuery = { querytext: query };\r\n }\r\n else {\r\n finalQuery = query;\r\n }\r\n return this.create(SearchSuggest).execute(finalQuery);\r\n };\r\n /**\r\n * Executes a search against this web context\r\n *\r\n * @param query The SearchQuery definition\r\n */\r\n SPRest.prototype.search = function (query) {\r\n return this.create(Search).execute(query);\r\n };\r\n /**\r\n * Executes the provided search query, caching the results\r\n *\r\n * @param query The SearchQuery definition\r\n * @param options The set of caching options used to store the results\r\n */\r\n SPRest.prototype.searchWithCaching = function (query, options) {\r\n return this.create(Search).usingCaching(options).execute(query);\r\n };\r\n Object.defineProperty(SPRest.prototype, \"site\", {\r\n /**\r\n * Begins a site collection scoped REST request\r\n *\r\n */\r\n get: function () {\r\n return this.create(Site);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SPRest.prototype, \"web\", {\r\n /**\r\n * Begins a web scoped REST request\r\n *\r\n */\r\n get: function () {\r\n return this.create(Web);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SPRest.prototype, \"profiles\", {\r\n /**\r\n * Access to user profile methods\r\n *\r\n */\r\n get: function () {\r\n return this.create(UserProfileQuery);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SPRest.prototype, \"social\", {\r\n /**\r\n * Access to social methods\r\n */\r\n get: function () {\r\n return this.create(SocialQuery);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SPRest.prototype, \"navigation\", {\r\n /**\r\n * Access to the site collection level navigation service\r\n */\r\n get: function () {\r\n return new NavigationService();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a new batch object for use with the SharePointQueryable.addToBatch method\r\n *\r\n */\r\n SPRest.prototype.createBatch = function () {\r\n return this.web.createBatch();\r\n };\r\n Object.defineProperty(SPRest.prototype, \"utility\", {\r\n /**\r\n * Static utilities methods from SP.Utilities.Utility\r\n */\r\n get: function () {\r\n return this.create(UtilityMethod, \"\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles creating and configuring the objects returned from this class\r\n *\r\n * @param fm The factory method used to create the instance\r\n * @param path Optional additional path information to pass to the factory method\r\n */\r\n SPRest.prototype.create = function (fm, path) {\r\n return new fm(this._baseUrl, path).configure(this._options);\r\n };\r\n return SPRest;\r\n}());\r\nvar sp = new SPRest();\n\nexport { odataUrlFrom, spODataEntity, spODataEntityArray, SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection, SharePointQueryableSecurable, FileFolderShared, SharePointQueryableShareable, SharePointQueryableShareableFile, SharePointQueryableShareableFolder, SharePointQueryableShareableItem, SharePointQueryableShareableWeb, AppCatalog, App, SPBatch, ContentType, ContentTypes, FieldLink, FieldLinks, Field, Fields, CheckinType, WebPartsPersonalizationScope, MoveOperations, TemplateFileType, File, Files, Folder, Folders, SPHttpClient, Item, Items, ItemVersion, ItemVersions, PagedItemCollection, NavigationNodes, NavigationNode, NavigationService, List, Lists, RegionalSettings, InstalledLanguages, TimeZone, TimeZones, sp, SPRest, RoleDefinitionBindings, Search, SearchQueryBuilder, SearchResults, SortDirection, ReorderingRuleMatchType, QueryPropertyValueType, SearchBuiltInSourceId, SearchSuggest, Site, UserProfileQuery, toAbsoluteUrl, extractWebUrl, UtilityMethod, View, Views, ViewFields, WebPartDefinitions, WebPartDefinition, WebPart, Web, PromotedState, ClientSidePage, CanvasSection, CanvasControl, CanvasColumn, ClientSidePart, ClientSideText, ClientSideWebpart, Comments, Comment, Replies, SocialQuery, MySocialQuery, SocialActorType, SocialActorTypes, SocialFollowResult, SocialStatusCode, ControlMode, FieldTypes, DateTimeFieldFormatType, AddFieldOptions, CalendarType, UrlFieldFormatType, PermissionKind, PrincipalType$1 as PrincipalType, PrincipalSource, RoleType, PageType, SharingLinkKind, SharingRole, SharingOperationStatusCode, SPSharedObjectType, SharingDomainRestrictionMode, RenderListDataOptions, FieldUserSelectionMode, ChoiceFieldFormatType, UrlZone };\n//# sourceMappingURL=sp.es5.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dist/packages/sp/dist/sp.es5.js\n// module id = 9\n// module chunks = 0","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 10\n// module chunks = 0","/**\n@license\n * @pnp/odata v1.2.1 - pnp - provides shared odata functionality and base classes\n * MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)\n * Copyright (c) 2018 Microsoft\n * docs: https://pnp.github.io/pnpjs/\n * source: https:github.com/pnp/pnpjs\n * bugs: https://github.com/pnp/pnpjs/issues\n */\nimport { RuntimeConfig, dateAdd, PnPClientStorage, isFunc, hOP, extend, combine, mergeOptions, objectDefinedNotNull, getGUID } from '@pnp/common';\nimport { __extends, __decorate } from 'tslib';\nimport { Logger } from '@pnp/logging';\n\nvar CachingOptions = /** @class */ (function () {\r\n function CachingOptions(key) {\r\n this.key = key;\r\n this.expiration = dateAdd(new Date(), \"second\", RuntimeConfig.defaultCachingTimeoutSeconds);\r\n this.storeName = RuntimeConfig.defaultCachingStore;\r\n }\r\n Object.defineProperty(CachingOptions.prototype, \"store\", {\r\n get: function () {\r\n if (this.storeName === \"local\") {\r\n return CachingOptions.storage.local;\r\n }\r\n else {\r\n return CachingOptions.storage.session;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n CachingOptions.storage = new PnPClientStorage();\r\n return CachingOptions;\r\n}());\r\nvar CachingParserWrapper = /** @class */ (function () {\r\n function CachingParserWrapper(parser, cacheOptions) {\r\n this.parser = parser;\r\n this.cacheOptions = cacheOptions;\r\n }\r\n CachingParserWrapper.prototype.parse = function (response) {\r\n var _this = this;\r\n return this.parser.parse(response).then(function (r) { return _this.cacheData(r); });\r\n };\r\n CachingParserWrapper.prototype.cacheData = function (data) {\r\n if (this.cacheOptions.store !== null) {\r\n this.cacheOptions.store.put(this.cacheOptions.key, data, this.cacheOptions.expiration);\r\n }\r\n return data;\r\n };\r\n return CachingParserWrapper;\r\n}());\n\nvar ODataParserBase = /** @class */ (function () {\r\n function ODataParserBase() {\r\n }\r\n ODataParserBase.prototype.parse = function (r) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n if (_this.handleError(r, reject)) {\r\n _this.parseImpl(r, resolve, reject);\r\n }\r\n });\r\n };\r\n ODataParserBase.prototype.parseImpl = function (r, resolve, reject) {\r\n var _this = this;\r\n if ((r.headers.has(\"Content-Length\") && parseFloat(r.headers.get(\"Content-Length\")) === 0) || r.status === 204) {\r\n resolve({});\r\n }\r\n else {\r\n // patch to handle cases of 200 response with no or whitespace only bodies (#487 & #545)\r\n r.text()\r\n .then(function (txt) { return txt.replace(/\\s/ig, \"\").length > 0 ? JSON.parse(txt) : {}; })\r\n .then(function (json) { return resolve(_this.parseODataJSON(json)); })\r\n .catch(function (e) { return reject(e); });\r\n }\r\n };\r\n /**\r\n * Handles a response with ok === false by parsing the body and creating a ProcessHttpClientResponseException\r\n * which is passed to the reject delegate. This method returns true if there is no error, otherwise false\r\n *\r\n * @param r Current response object\r\n * @param reject reject delegate for the surrounding promise\r\n */\r\n ODataParserBase.prototype.handleError = function (r, reject) {\r\n if (!r.ok) {\r\n // read the response as text, it may not be valid json\r\n r.json().then(function (json) {\r\n // include the headers as they contain diagnostic information\r\n var data = {\r\n responseBody: json,\r\n responseHeaders: r.headers,\r\n };\r\n reject(new Error(\"Error making HttpClient request in queryable: [\" + r.status + \"] \" + r.statusText + \" ::> \" + JSON.stringify(data)));\r\n }).catch(function (e) {\r\n reject(new Error(\"Error making HttpClient request in queryable: [\" + r.status + \"] \" + r.statusText + \" ::> \" + e));\r\n });\r\n }\r\n return r.ok;\r\n };\r\n /**\r\n * Normalizes the json response by removing the various nested levels\r\n *\r\n * @param json json object to parse\r\n */\r\n ODataParserBase.prototype.parseODataJSON = function (json) {\r\n var result = json;\r\n if (hOP(json, \"d\")) {\r\n if (hOP(json.d, \"results\")) {\r\n result = json.d.results;\r\n }\r\n else {\r\n result = json.d;\r\n }\r\n }\r\n else if (hOP(json, \"value\")) {\r\n result = json.value;\r\n }\r\n return result;\r\n };\r\n return ODataParserBase;\r\n}());\r\nvar ODataDefaultParser = /** @class */ (function (_super) {\r\n __extends(ODataDefaultParser, _super);\r\n function ODataDefaultParser() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return ODataDefaultParser;\r\n}(ODataParserBase));\r\nvar TextParser = /** @class */ (function (_super) {\r\n __extends(TextParser, _super);\r\n function TextParser() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TextParser.prototype.parseImpl = function (r, resolve) {\r\n r.text().then(resolve);\r\n };\r\n return TextParser;\r\n}(ODataParserBase));\r\nvar BlobParser = /** @class */ (function (_super) {\r\n __extends(BlobParser, _super);\r\n function BlobParser() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n BlobParser.prototype.parseImpl = function (r, resolve) {\r\n r.blob().then(resolve);\r\n };\r\n return BlobParser;\r\n}(ODataParserBase));\r\nvar JSONParser = /** @class */ (function (_super) {\r\n __extends(JSONParser, _super);\r\n function JSONParser() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n JSONParser.prototype.parseImpl = function (r, resolve) {\r\n r.json().then(resolve);\r\n };\r\n return JSONParser;\r\n}(ODataParserBase));\r\nvar BufferParser = /** @class */ (function (_super) {\r\n __extends(BufferParser, _super);\r\n function BufferParser() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n BufferParser.prototype.parseImpl = function (r, resolve) {\r\n if (isFunc(r.arrayBuffer)) {\r\n r.arrayBuffer().then(resolve);\r\n }\r\n else {\r\n r.buffer().then(resolve);\r\n }\r\n };\r\n return BufferParser;\r\n}(ODataParserBase));\r\nvar LambdaParser = /** @class */ (function () {\r\n function LambdaParser(parser) {\r\n this.parser = parser;\r\n }\r\n LambdaParser.prototype.parse = function (r) {\r\n return this.parser(r);\r\n };\r\n return LambdaParser;\r\n}());\n\n/**\r\n * Resolves the context's result value\r\n *\r\n * @param context The current context\r\n */\r\nfunction returnResult(context) {\r\n Logger.log({\r\n data: Logger.activeLogLevel === 0 /* Verbose */ ? context.result : {},\r\n level: 1 /* Info */,\r\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Returning result from pipeline. Set logging to verbose to see data.\",\r\n });\r\n return Promise.resolve(context.result || null);\r\n}\r\n/**\r\n * Sets the result on the context\r\n */\r\nfunction setResult(context, value) {\r\n return new Promise(function (resolve) {\r\n context.result = value;\r\n context.hasResult = true;\r\n resolve(context);\r\n });\r\n}\r\n/**\r\n * Invokes the next method in the provided context's pipeline\r\n *\r\n * @param c The current request context\r\n */\r\nfunction next(c) {\r\n if (c.pipeline.length > 0) {\r\n return c.pipeline.shift()(c);\r\n }\r\n else {\r\n return Promise.resolve(c);\r\n }\r\n}\r\n/**\r\n * Executes the current request context's pipeline\r\n *\r\n * @param context Current context\r\n */\r\nfunction pipe(context) {\r\n if (context.pipeline.length < 1) {\r\n Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Request pipeline contains no methods!\", 2 /* Warning */);\r\n }\r\n var promise = next(context).then(function (ctx) { return returnResult(ctx); }).catch(function (e) {\r\n Logger.error(e);\r\n throw e;\r\n });\r\n if (context.isBatched) {\r\n // this will block the batch's execute method from returning until the child requets have been resolved\r\n context.batch.addResolveBatchDependency(promise);\r\n }\r\n return promise;\r\n}\r\n/**\r\n * decorator factory applied to methods in the pipeline to control behavior\r\n */\r\nfunction requestPipelineMethod(alwaysRun) {\r\n if (alwaysRun === void 0) { alwaysRun = false; }\r\n return function (target, propertyKey, descriptor) {\r\n var method = descriptor.value;\r\n descriptor.value = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n // if we have a result already in the pipeline, pass it along and don't call the tagged method\r\n if (!alwaysRun && args.length > 0 && hOP(args[0], \"hasResult\") && args[0].hasResult) {\r\n Logger.write(\"[\" + args[0].requestId + \"] (\" + (new Date()).getTime() + \") Skipping request pipeline method \" + propertyKey + \", existing result in pipeline.\", 0 /* Verbose */);\r\n return Promise.resolve(args[0]);\r\n }\r\n // apply the tagged method\r\n Logger.write(\"[\" + args[0].requestId + \"] (\" + (new Date()).getTime() + \") Calling request pipeline method \" + propertyKey + \".\", 0 /* Verbose */);\r\n // then chain the next method in the context's pipeline - allows for dynamic pipeline\r\n return method.apply(target, args).then(function (ctx) { return next(ctx); });\r\n };\r\n };\r\n}\r\n/**\r\n * Contains the methods used within the request pipeline\r\n */\r\nvar PipelineMethods = /** @class */ (function () {\r\n function PipelineMethods() {\r\n }\r\n /**\r\n * Logs the start of the request\r\n */\r\n PipelineMethods.logStart = function (context) {\r\n return new Promise(function (resolve) {\r\n Logger.log({\r\n data: Logger.activeLogLevel === 1 /* Info */ ? {} : context,\r\n level: 1 /* Info */,\r\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Beginning \" + context.verb + \" request (\" + context.requestAbsoluteUrl + \")\",\r\n });\r\n resolve(context);\r\n });\r\n };\r\n /**\r\n * Handles caching of the request\r\n */\r\n PipelineMethods.caching = function (context) {\r\n return new Promise(function (resolve) {\r\n // handle caching, if applicable\r\n if (context.isCached) {\r\n Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Caching is enabled for request, checking cache...\", 1 /* Info */);\r\n var cacheOptions = new CachingOptions(context.requestAbsoluteUrl.toLowerCase());\r\n if (context.cachingOptions !== undefined) {\r\n cacheOptions = extend(cacheOptions, context.cachingOptions);\r\n }\r\n // we may not have a valid store\r\n if (cacheOptions.store !== null) {\r\n // check if we have the data in cache and if so resolve the promise and return\r\n var data = cacheOptions.store.get(cacheOptions.key);\r\n if (data !== null) {\r\n // ensure we clear any held batch dependency we are resolving from the cache\r\n Logger.log({\r\n data: Logger.activeLogLevel === 1 /* Info */ ? {} : data,\r\n level: 1 /* Info */,\r\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Value returned from cache.\",\r\n });\r\n if (isFunc(context.batchDependency)) {\r\n context.batchDependency();\r\n }\r\n // handle the case where a parser needs to take special actions with a cached result\r\n if (hOP(context.parser, \"hydrate\")) {\r\n data = context.parser.hydrate(data);\r\n }\r\n return setResult(context, data).then(function (ctx) { return resolve(ctx); });\r\n }\r\n }\r\n Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Value not found in cache.\", 1 /* Info */);\r\n // if we don't then wrap the supplied parser in the caching parser wrapper\r\n // and send things on their way\r\n context.parser = new CachingParserWrapper(context.parser, cacheOptions);\r\n }\r\n return resolve(context);\r\n });\r\n };\r\n /**\r\n * Sends the request\r\n */\r\n PipelineMethods.send = function (context) {\r\n return new Promise(function (resolve, reject) {\r\n // send or batch the request\r\n if (context.isBatched) {\r\n // we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise\r\n var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser, context.requestId);\r\n // we release the dependency here to ensure the batch does not execute until the request is added to the batch\r\n if (isFunc(context.batchDependency)) {\r\n context.batchDependency();\r\n }\r\n Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Batching request in batch \" + context.batch.batchId + \".\", 1 /* Info */);\r\n // we set the result as the promise which will be resolved by the batch's execution\r\n resolve(setResult(context, p));\r\n }\r\n else {\r\n Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Sending request.\", 1 /* Info */);\r\n // we are not part of a batch, so proceed as normal\r\n var client = context.clientFactory();\r\n var opts = extend(context.options || {}, { method: context.verb });\r\n client.fetch(context.requestAbsoluteUrl, opts)\r\n .then(function (response) { return context.parser.parse(response); })\r\n .then(function (result) { return setResult(context, result); })\r\n .then(function (ctx) { return resolve(ctx); })\r\n .catch(function (e) { return reject(e); });\r\n }\r\n });\r\n };\r\n /**\r\n * Logs the end of the request\r\n */\r\n PipelineMethods.logEnd = function (context) {\r\n return new Promise(function (resolve) {\r\n if (context.isBatched) {\r\n Logger.log({\r\n data: Logger.activeLogLevel === 1 /* Info */ ? {} : context,\r\n level: 1 /* Info */,\r\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") \" + context.verb + \" request will complete in batch \" + context.batch.batchId + \".\",\r\n });\r\n }\r\n else {\r\n Logger.log({\r\n data: Logger.activeLogLevel === 1 /* Info */ ? {} : context,\r\n level: 1 /* Info */,\r\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Completing \" + context.verb + \" request.\",\r\n });\r\n }\r\n resolve(context);\r\n });\r\n };\r\n __decorate([\r\n requestPipelineMethod(true)\r\n ], PipelineMethods, \"logStart\", null);\r\n __decorate([\r\n requestPipelineMethod()\r\n ], PipelineMethods, \"caching\", null);\r\n __decorate([\r\n requestPipelineMethod()\r\n ], PipelineMethods, \"send\", null);\r\n __decorate([\r\n requestPipelineMethod(true)\r\n ], PipelineMethods, \"logEnd\", null);\r\n return PipelineMethods;\r\n}());\r\nfunction getDefaultPipeline() {\r\n return [\r\n PipelineMethods.logStart,\r\n PipelineMethods.caching,\r\n PipelineMethods.send,\r\n PipelineMethods.logEnd,\r\n ].slice(0);\r\n}\n\nvar Queryable = /** @class */ (function () {\r\n function Queryable() {\r\n this._query = new Map();\r\n this._options = {};\r\n this._url = \"\";\r\n this._parentUrl = \"\";\r\n this._useCaching = false;\r\n this._cachingOptions = null;\r\n }\r\n /**\r\n * Gets the currentl url\r\n *\r\n */\r\n Queryable.prototype.toUrl = function () {\r\n return this._url;\r\n };\r\n /**\r\n * Directly concatonates the supplied string to the current url, not normalizing \"/\" chars\r\n *\r\n * @param pathPart The string to concatonate to the url\r\n */\r\n Queryable.prototype.concat = function (pathPart) {\r\n this._url += pathPart;\r\n return this;\r\n };\r\n Object.defineProperty(Queryable.prototype, \"query\", {\r\n /**\r\n * Provides access to the query builder for this url\r\n *\r\n */\r\n get: function () {\r\n return this._query;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets custom options for current object and all derived objects accessible via chaining\r\n *\r\n * @param options custom options\r\n */\r\n Queryable.prototype.configure = function (options) {\r\n mergeOptions(this._options, options);\r\n return this;\r\n };\r\n /**\r\n * Configures this instance from the configure options of the supplied instance\r\n *\r\n * @param o Instance from which options should be taken\r\n */\r\n Queryable.prototype.configureFrom = function (o) {\r\n mergeOptions(this._options, o._options);\r\n return this;\r\n };\r\n /**\r\n * Enables caching for this request\r\n *\r\n * @param options Defines the options used when caching this request\r\n */\r\n Queryable.prototype.usingCaching = function (options) {\r\n if (!RuntimeConfig.globalCacheDisable) {\r\n this._useCaching = true;\r\n if (options !== undefined) {\r\n this._cachingOptions = options;\r\n }\r\n }\r\n return this;\r\n };\r\n Queryable.prototype.getCore = function (parser, options) {\r\n if (parser === void 0) { parser = new JSONParser(); }\r\n if (options === void 0) { options = {}; }\r\n return this.toRequestContext(\"GET\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n Queryable.prototype.postCore = function (options, parser) {\r\n if (options === void 0) { options = {}; }\r\n if (parser === void 0) { parser = new JSONParser(); }\r\n return this.toRequestContext(\"POST\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n Queryable.prototype.patchCore = function (options, parser) {\r\n if (options === void 0) { options = {}; }\r\n if (parser === void 0) { parser = new JSONParser(); }\r\n return this.toRequestContext(\"PATCH\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n Queryable.prototype.deleteCore = function (options, parser) {\r\n if (options === void 0) { options = {}; }\r\n if (parser === void 0) { parser = new JSONParser(); }\r\n return this.toRequestContext(\"DELETE\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n Queryable.prototype.putCore = function (options, parser) {\r\n if (options === void 0) { options = {}; }\r\n if (parser === void 0) { parser = new JSONParser(); }\r\n return this.toRequestContext(\"PUT\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n /**\r\n * Appends the given string and normalizes \"/\" chars\r\n *\r\n * @param pathPart The string to append\r\n */\r\n Queryable.prototype.append = function (pathPart) {\r\n this._url = combine(this._url, pathPart);\r\n };\r\n Object.defineProperty(Queryable.prototype, \"parentUrl\", {\r\n /**\r\n * Gets the parent url used when creating this instance\r\n *\r\n */\r\n get: function () {\r\n return this._parentUrl;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Extends this queryable from the provided parent\r\n *\r\n * @param parent Parent queryable from which we will derive a base url\r\n * @param path Additional path\r\n */\r\n Queryable.prototype.extend = function (parent, path) {\r\n this._parentUrl = parent._url;\r\n this._url = combine(this._parentUrl, path);\r\n this.configureFrom(parent);\r\n };\r\n return Queryable;\r\n}());\r\nvar ODataQueryable = /** @class */ (function (_super) {\r\n __extends(ODataQueryable, _super);\r\n function ODataQueryable() {\r\n var _this = _super.call(this) || this;\r\n _this._batch = null;\r\n return _this;\r\n }\r\n /**\r\n * Adds this query to the supplied batch\r\n *\r\n * @example\r\n * ```\r\n *\r\n * let b = pnp.sp.createBatch();\r\n * pnp.sp.web.inBatch(b).get().then(...);\r\n * b.execute().then(...)\r\n * ```\r\n */\r\n ODataQueryable.prototype.inBatch = function (batch) {\r\n if (this.batch !== null) {\r\n throw new Error(\"This query is already part of a batch.\");\r\n }\r\n this._batch = batch;\r\n return this;\r\n };\r\n /**\r\n * Gets the currentl url\r\n *\r\n */\r\n ODataQueryable.prototype.toUrl = function () {\r\n return this._url;\r\n };\r\n /**\r\n * Executes the currently built request\r\n *\r\n * @param parser Allows you to specify a parser to handle the result\r\n * @param getOptions The options used for this request\r\n */\r\n ODataQueryable.prototype.get = function (parser, options) {\r\n if (parser === void 0) { parser = new ODataDefaultParser(); }\r\n if (options === void 0) { options = {}; }\r\n return this.getCore(parser, options);\r\n };\r\n ODataQueryable.prototype.getCore = function (parser, options) {\r\n if (parser === void 0) { parser = new ODataDefaultParser(); }\r\n if (options === void 0) { options = {}; }\r\n return this.toRequestContext(\"GET\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n ODataQueryable.prototype.postCore = function (options, parser) {\r\n if (options === void 0) { options = {}; }\r\n if (parser === void 0) { parser = new ODataDefaultParser(); }\r\n return this.toRequestContext(\"POST\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n ODataQueryable.prototype.patchCore = function (options, parser) {\r\n if (options === void 0) { options = {}; }\r\n if (parser === void 0) { parser = new ODataDefaultParser(); }\r\n return this.toRequestContext(\"PATCH\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n ODataQueryable.prototype.deleteCore = function (options, parser) {\r\n if (options === void 0) { options = {}; }\r\n if (parser === void 0) { parser = new ODataDefaultParser(); }\r\n return this.toRequestContext(\"DELETE\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n ODataQueryable.prototype.putCore = function (options, parser) {\r\n if (options === void 0) { options = {}; }\r\n if (parser === void 0) { parser = new ODataDefaultParser(); }\r\n return this.toRequestContext(\"PUT\", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });\r\n };\r\n /**\r\n * Blocks a batch call from occuring, MUST be cleared by calling the returned function\r\n */\r\n ODataQueryable.prototype.addBatchDependency = function () {\r\n if (this._batch !== null) {\r\n return this._batch.addDependency();\r\n }\r\n return function () { return null; };\r\n };\r\n Object.defineProperty(ODataQueryable.prototype, \"hasBatch\", {\r\n /**\r\n * Indicates if the current query has a batch associated\r\n *\r\n */\r\n get: function () {\r\n return objectDefinedNotNull(this._batch);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ODataQueryable.prototype, \"batch\", {\r\n /**\r\n * The batch currently associated with this query or null\r\n *\r\n */\r\n get: function () {\r\n return this.hasBatch ? this._batch : null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ODataQueryable;\r\n}(Queryable));\n\nvar ODataBatch = /** @class */ (function () {\r\n function ODataBatch(_batchId) {\r\n if (_batchId === void 0) { _batchId = getGUID(); }\r\n this._batchId = _batchId;\r\n this._reqs = [];\r\n this._deps = [];\r\n this._rDeps = [];\r\n }\r\n Object.defineProperty(ODataBatch.prototype, \"batchId\", {\r\n get: function () {\r\n return this._batchId;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ODataBatch.prototype, \"requests\", {\r\n /**\r\n * The requests contained in this batch\r\n */\r\n get: function () {\r\n return this._reqs;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n *\r\n * @param url Request url\r\n * @param method Request method (GET, POST, etc)\r\n * @param options Any request options\r\n * @param parser The parser used to handle the eventual return from the query\r\n * @param id An identifier used to track a request within a batch\r\n */\r\n ODataBatch.prototype.add = function (url, method, options, parser, id) {\r\n var info = {\r\n id: id,\r\n method: method.toUpperCase(),\r\n options: options,\r\n parser: parser,\r\n reject: null,\r\n resolve: null,\r\n url: url,\r\n };\r\n var p = new Promise(function (resolve, reject) {\r\n info.resolve = resolve;\r\n info.reject = reject;\r\n });\r\n this._reqs.push(info);\r\n return p;\r\n };\r\n /**\r\n * Adds a dependency insuring that some set of actions will occur before a batch is processed.\r\n * MUST be cleared using the returned resolve delegate to allow batches to run\r\n */\r\n ODataBatch.prototype.addDependency = function () {\r\n var resolver = function () { return void (0); };\r\n this._deps.push(new Promise(function (resolve) {\r\n resolver = resolve;\r\n }));\r\n return resolver;\r\n };\r\n /**\r\n * The batch's execute method will not resolve util any promises added here resolve\r\n *\r\n * @param p The dependent promise\r\n */\r\n ODataBatch.prototype.addResolveBatchDependency = function (p) {\r\n this._rDeps.push(p);\r\n };\r\n /**\r\n * Execute the current batch and resolve the associated promises\r\n *\r\n * @returns A promise which will be resolved once all of the batch's child promises have resolved\r\n */\r\n ODataBatch.prototype.execute = function () {\r\n var _this = this;\r\n // we need to check the dependencies twice due to how different engines handle things.\r\n // We can get a second set of promises added during the first set resolving\r\n return Promise.all(this._deps)\r\n .then(function () { return Promise.all(_this._deps); })\r\n .then(function () { return _this.executeImpl(); })\r\n .then(function () { return Promise.all(_this._rDeps); })\r\n .then(function () { return void (0); });\r\n };\r\n return ODataBatch;\r\n}());\n\nexport { CachingOptions, CachingParserWrapper, ODataParserBase, ODataDefaultParser, TextParser, BlobParser, JSONParser, BufferParser, LambdaParser, setResult, pipe, requestPipelineMethod, PipelineMethods, getDefaultPipeline, Queryable, ODataQueryable, ODataBatch };\n//# sourceMappingURL=odata.es5.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dist/packages/odata/dist/odata.es5.js\n// module id = 11\n// module chunks = 0","import * as tslib_1 from \"tslib\";\r\nimport { ClientSvcQueryable, MethodParams, property, } from \"@pnp/sp-clientsvc\";\r\nimport { stringIsNullOrEmpty } from \"@pnp/common\";\r\n/**\r\n * Represents a collection of labels\r\n */\r\nvar Labels = /** @class */ (function (_super) {\r\n tslib_1.__extends(Labels, _super);\r\n function Labels(parent, _objectPaths) {\r\n if (parent === void 0) { parent = \"\"; }\r\n if (_objectPaths === void 0) { _objectPaths = null; }\r\n var _this = _super.call(this, parent, _objectPaths) || this;\r\n _this._objectPaths.add(property(\"Labels\"));\r\n return _this;\r\n }\r\n /**\r\n * Gets a label from the collection by its value\r\n *\r\n * @param value The value to retrieve\r\n */\r\n Labels.prototype.getByValue = function (value) {\r\n var params = MethodParams.build().string(value);\r\n return this.getChild(Label, \"GetByValue\", params);\r\n };\r\n /**\r\n * Loads the data and merges with with the ILabel instances\r\n */\r\n Labels.prototype.get = function () {\r\n var _this = this;\r\n return this.sendGetCollection(function (d) {\r\n if (!stringIsNullOrEmpty(d.Value)) {\r\n return _this.getByValue(d.Value);\r\n }\r\n throw new Error(\"Could not find Value in Labels.get(). You must include at least one of these in your select fields.\");\r\n });\r\n };\r\n return Labels;\r\n}(ClientSvcQueryable));\r\nexport { Labels };\r\n/**\r\n * Represents a label instance\r\n */\r\nvar Label = /** @class */ (function (_super) {\r\n tslib_1.__extends(Label, _super);\r\n function Label() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Gets the data for this Label\r\n */\r\n Label.prototype.get = function () {\r\n return this.sendGet(Label);\r\n };\r\n /**\r\n * Sets this label as the default\r\n */\r\n Label.prototype.setAsDefaultForLanguage = function () {\r\n return this.invokeNonQuery(\"SetAsDefaultForLanguage\");\r\n };\r\n /**\r\n * Deletes this label\r\n */\r\n Label.prototype.delete = function () {\r\n return this.invokeNonQuery(\"DeleteObject\");\r\n };\r\n return Label;\r\n}(ClientSvcQueryable));\r\nexport { Label };\r\n//# sourceMappingURL=labels.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/sp-taxonomy/es5/src/labels.js\n// module id = 12\n// module chunks = 0","export * from \"./src/taxonomy\";\r\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/sp-taxonomy/es5/index.js\n// module id = 13\n// module chunks = 0","import { Session } from \"./session\";\r\n// export an existing session instance\r\nexport var taxonomy = new Session();\r\nexport * from \"./labels\";\r\nexport * from \"./session\";\r\nexport * from \"./termgroup\";\r\nexport * from \"./terms\";\r\nexport * from \"./termsets\";\r\nexport * from \"./termstores\";\r\nexport * from \"./types\";\r\n//# sourceMappingURL=taxonomy.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/sp-taxonomy/es5/src/taxonomy.js\n// module id = 14\n// module chunks = 0","/*! adal-angular v1.0.17 2018-02-27 */\r\nvar AuthenticationContext=function(){\"use strict\";return AuthenticationContext=function(a){if(this.REQUEST_TYPE={LOGIN:\"LOGIN\",RENEW_TOKEN:\"RENEW_TOKEN\",UNKNOWN:\"UNKNOWN\"},this.RESPONSE_TYPE={ID_TOKEN_TOKEN:\"id_token token\",TOKEN:\"token\"},this.CONSTANTS={ACCESS_TOKEN:\"access_token\",EXPIRES_IN:\"expires_in\",ID_TOKEN:\"id_token\",ERROR_DESCRIPTION:\"error_description\",SESSION_STATE:\"session_state\",ERROR:\"error\",STORAGE:{TOKEN_KEYS:\"adal.token.keys\",ACCESS_TOKEN_KEY:\"adal.access.token.key\",EXPIRATION_KEY:\"adal.expiration.key\",STATE_LOGIN:\"adal.state.login\",STATE_RENEW:\"adal.state.renew\",NONCE_IDTOKEN:\"adal.nonce.idtoken\",SESSION_STATE:\"adal.session.state\",USERNAME:\"adal.username\",IDTOKEN:\"adal.idtoken\",ERROR:\"adal.error\",ERROR_DESCRIPTION:\"adal.error.description\",LOGIN_REQUEST:\"adal.login.request\",LOGIN_ERROR:\"adal.login.error\",RENEW_STATUS:\"adal.token.renew.status\",ANGULAR_LOGIN_REQUEST:\"adal.angular.login.request\"},RESOURCE_DELIMETER:\"|\",CACHE_DELIMETER:\"||\",LOADFRAME_TIMEOUT:6e3,TOKEN_RENEW_STATUS_CANCELED:\"Canceled\",TOKEN_RENEW_STATUS_COMPLETED:\"Completed\",TOKEN_RENEW_STATUS_IN_PROGRESS:\"In Progress\",LOGGING_LEVEL:{ERROR:0,WARN:1,INFO:2,VERBOSE:3},LEVEL_STRING_MAP:{0:\"ERROR:\",1:\"WARNING:\",2:\"INFO:\",3:\"VERBOSE:\"},POPUP_WIDTH:483,POPUP_HEIGHT:600},AuthenticationContext.prototype._singletonInstance)return AuthenticationContext.prototype._singletonInstance;if(AuthenticationContext.prototype._singletonInstance=this,this.instance=\"https://login.microsoftonline.com/\",this.config={},this.callback=null,this.popUp=!1,this.isAngular=!1,this._user=null,this._activeRenewals={},this._loginInProgress=!1,this._acquireTokenInProgress=!1,this._renewStates=[],this._callBackMappedToRenewStates={},this._callBacksMappedToRenewStates={},this._openedWindows=[],this._requestType=this.REQUEST_TYPE.LOGIN,window._adalInstance=this,a.displayCall&&\"function\"!=typeof a.displayCall)throw new Error(\"displayCall is not a function\");if(!a.clientId)throw new Error(\"clientId is required\");this.config=this._cloneConfig(a),void 0===this.config.navigateToLoginRequestUrl&&(this.config.navigateToLoginRequestUrl=!0),this.config.popUp&&(this.popUp=!0),this.config.callback&&\"function\"==typeof this.config.callback&&(this.callback=this.config.callback),this.config.instance&&(this.instance=this.config.instance),this.config.loginResource||(this.config.loginResource=this.config.clientId),this.config.redirectUri||(this.config.redirectUri=window.location.href.split(\"?\")[0].split(\"#\")[0]),this.config.postLogoutRedirectUri||(this.config.postLogoutRedirectUri=window.location.href.split(\"?\")[0].split(\"#\")[0]),this.config.anonymousEndpoints||(this.config.anonymousEndpoints=[]),this.config.isAngular&&(this.isAngular=this.config.isAngular),this.config.loadFrameTimeout&&(this.CONSTANTS.LOADFRAME_TIMEOUT=this.config.loadFrameTimeout)},\"undefined\"!=typeof window&&(window.Logging={piiLoggingEnabled:!1,level:0,log:function(a){}}),AuthenticationContext.prototype.login=function(){if(this._loginInProgress)return void this.info(\"Login in progress\");this._loginInProgress=!0;var a=this._guid();this.config.state=a,this._idTokenNonce=this._guid();var b=this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST);b&&\"\"!==b?this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,\"\"):b=window.location.href,this.verbose(\"Expected state: \"+a+\" startPage:\"+b),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,b),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,\"\"),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,a,!0),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this._saveItem(this.CONSTANTS.STORAGE.ERROR,\"\"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,\"\");var c=this._getNavigateUrl(\"id_token\",null)+\"&nonce=\"+encodeURIComponent(this._idTokenNonce);this.config.displayCall?this.config.displayCall(c):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,\"\"),this._renewStates.push(a),this.registerCallback(a,this.config.clientId,this.callback),this._loginPopup(c)):this.promptUser(c)},AuthenticationContext.prototype._openPopup=function(a,b,c,d){try{var e=window.screenLeft?window.screenLeft:window.screenX,f=window.screenTop?window.screenTop:window.screenY,g=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=g/2-c/2+e,j=h/2-d/2+f,k=window.open(a,b,\"width=\"+c+\", height=\"+d+\", top=\"+j+\", left=\"+i);return k.focus&&k.focus(),k}catch(a){return this.warn(\"Error opening popup, \"+a.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},AuthenticationContext.prototype._handlePopupError=function(a,b,c,d,e){this.warn(d),this._saveItem(this.CONSTANTS.STORAGE.ERROR,c),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,d),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,e),b&&this._activeRenewals[b]&&(this._activeRenewals[b]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,a&&a(d,null,c)},AuthenticationContext.prototype._loginPopup=function(a,b,c){var d=this._openPopup(a,\"login\",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),e=c||this.callback;if(null==d){var f=\"Popup Window is null. This can happen if you are using IE\";return void this._handlePopupError(e,b,\"Error opening popup\",f,f)}if(this._openedWindows.push(d),-1!=this.config.redirectUri.indexOf(\"#\"))var g=this.config.redirectUri.split(\"#\")[0];else var g=this.config.redirectUri;var h=this,i=window.setInterval(function(){if(!d||d.closed||void 0===d.closed){var a=\"Popup Window closed\",c=\"Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge\";return h.isAngular&&h._broadcast(\"adal:popUpClosed\",c+h.CONSTANTS.RESOURCE_DELIMETER+a),h._handlePopupError(e,b,a,c,c),void window.clearInterval(i)}try{var f=d.location;if(-1!=encodeURI(f.href).indexOf(encodeURI(g)))return h.isAngular?h._broadcast(\"adal:popUpHashChanged\",f.hash):h.handleWindowCallback(f.hash),window.clearInterval(i),h._loginInProgress=!1,h._acquireTokenInProgress=!1,h.info(\"Closing popup window\"),h._openedWindows=[],void d.close()}catch(a){}},1)},AuthenticationContext.prototype._broadcast=function(a,b){!function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent(\"CustomEvent\");return c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail),c}if(\"function\"==typeof window.CustomEvent)return!1;a.prototype=window.Event.prototype,window.CustomEvent=a}();var c=new CustomEvent(a,{detail:b});window.dispatchEvent(c)},AuthenticationContext.prototype.loginInProgress=function(){return this._loginInProgress},AuthenticationContext.prototype._hasResource=function(a){var b=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);return b&&!this._isEmpty(b)&&b.indexOf(a+this.CONSTANTS.RESOURCE_DELIMETER)>-1},AuthenticationContext.prototype.getCachedToken=function(a){if(!this._hasResource(a))return null;var b=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+a),c=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+a),d=this.config.expireOffsetSeconds||300;return c&&c>this._now()+d?b:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+a,\"\"),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+a,0),null)},AuthenticationContext.prototype.getCachedUser=function(){if(this._user)return this._user;var a=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);return this._user=this._createUser(a),this._user},AuthenticationContext.prototype.registerCallback=function(a,b,c){this._activeRenewals[b]=a,this._callBacksMappedToRenewStates[a]||(this._callBacksMappedToRenewStates[a]=[]);var d=this;this._callBacksMappedToRenewStates[a].push(c),this._callBackMappedToRenewStates[a]||(this._callBackMappedToRenewStates[a]=function(c,e,f,g){d._activeRenewals[b]=null;for(var h=0;h
-1)){var b=this._user.profile.upn.split(\"@\");a+=\"&domain_hint=\"+encodeURIComponent(b[b.length-1])}return a},AuthenticationContext.prototype._createUser=function(a){var b=null,c=this._extractIdToken(a);return c&&c.hasOwnProperty(\"aud\")&&(c.aud.toLowerCase()===this.config.clientId.toLowerCase()?(b={userName:\"\",profile:c},c.hasOwnProperty(\"upn\")?b.userName=c.upn:c.hasOwnProperty(\"email\")&&(b.userName=c.email)):this.warn(\"IdToken has invalid aud field\")),b},AuthenticationContext.prototype._getHash=function(a){return a.indexOf(\"#/\")>-1?a=a.substring(a.indexOf(\"#/\")+2):a.indexOf(\"#\")>-1&&(a=a.substring(1)),a},AuthenticationContext.prototype.isCallback=function(a){a=this._getHash(a);var b=this._deserialize(a);return b.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||b.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||b.hasOwnProperty(this.CONSTANTS.ID_TOKEN)},AuthenticationContext.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},AuthenticationContext.prototype.getRequestInfo=function(a){a=this._getHash(a);var b=this._deserialize(a),c={valid:!1,parameters:{},stateMatch:!1,stateResponse:\"\",requestType:this.REQUEST_TYPE.UNKNOWN};if(b&&(c.parameters=b,b.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||b.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||b.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){c.valid=!0;var d=\"\";if(!b.hasOwnProperty(\"state\"))return this.warn(\"No state returned\"),c;if(this.verbose(\"State: \"+b.state),d=b.state,c.stateResponse=d,this._matchState(c))return c;if(!c.stateMatch&&window.parent){c.requestType=this._requestType;for(var e=this._renewStates,f=0;f-1&&b+1-1)return null;if(this.config&&this.config.endpoints)for(var c in this.config.endpoints)if(a.indexOf(c)>-1)return this.config.endpoints[c];return a.indexOf(\"http://\")>-1||a.indexOf(\"https://\")>-1?this._getHostFromUri(a)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null:this.config.loginResource},AuthenticationContext.prototype._getHostFromUri=function(a){var b=String(a).replace(/^(https?:)\\/\\//,\"\");return b=b.split(\"/\")[0]},AuthenticationContext.prototype.handleWindowCallback=function(a){if(null==a&&(a=window.location.hash),this.isCallback(a)){var b=null,c=!1;this._openedWindows.length>0&&this._openedWindows[this._openedWindows.length-1].opener&&this._openedWindows[this._openedWindows.length-1].opener._adalInstance?(b=this._openedWindows[this._openedWindows.length-1].opener._adalInstance,c=!0):window.parent&&window.parent._adalInstance&&(b=window.parent._adalInstance);var d,e,f=b.getRequestInfo(a),g=null;e=c||window.parent!==window?b._callBackMappedToRenewStates[f.stateResponse]:b.callback,b.info(\"Returned from redirect url\"),b.saveTokenFromHash(f),f.requestType===this.REQUEST_TYPE.RENEW_TOKEN&&window.parent?(window.parent!==window?b.verbose(\"Window is in iframe, acquiring token silently\"):b.verbose(\"acquiring token interactive in progress\"),d=f.parameters[b.CONSTANTS.ACCESS_TOKEN]||f.parameters[b.CONSTANTS.ID_TOKEN],g=b.CONSTANTS.ACCESS_TOKEN):f.requestType===this.REQUEST_TYPE.LOGIN&&(d=f.parameters[b.CONSTANTS.ID_TOKEN],g=b.CONSTANTS.ID_TOKEN);var h=f.parameters[b.CONSTANTS.ERROR_DESCRIPTION],i=f.parameters[b.CONSTANTS.ERROR];try{e&&e(h,d,i,g)}catch(a){b.error(\"Error occurred in user defined callback function: \"+a)}window.parent!==window||c||(b.config.navigateToLoginRequestUrl?window.location.href=b._getItem(b.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash=\"\")}},AuthenticationContext.prototype._getNavigateUrl=function(a,b){var c=\"common\";this.config.tenant&&(c=this.config.tenant);var d=this.instance+c+\"/oauth2/authorize\"+this._serialize(a,this.config,b)+this._addLibMetadata();return this.info(\"Navigate url:\"+d),d},AuthenticationContext.prototype._extractIdToken=function(a){var b=this._decodeJwt(a);if(!b)return null;try{var c=b.JWSPayload,d=this._base64DecodeStringUrlSafe(c);return d?JSON.parse(d):(this.info(\"The returned id_token could not be base64 url safe decoded.\"),null)}catch(a){this.error(\"The returned id_token could not be decoded\",a)}return null},AuthenticationContext.prototype._base64DecodeStringUrlSafe=function(a){return a=a.replace(/-/g,\"+\").replace(/_/g,\"/\"),window.atob?decodeURIComponent(escape(window.atob(a))):decodeURIComponent(escape(this._decode(a)))},AuthenticationContext.prototype._decode=function(a){var b=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";a=String(a).replace(/=+$/,\"\");var c=a.length;if(c%4==1)throw new Error(\"The token to be decoded is not correctly encoded.\");for(var d,e,f,g,h,i,j,k,l=\"\",m=0;m>16&255,j=h>>8&255,l+=String.fromCharCode(i,j);break}if(m+1===c-1){h=d<<18|e<<12,i=h>>16&255,l+=String.fromCharCode(i);break}h=d<<18|e<<12|f<<6|g,i=h>>16&255,j=h>>8&255,k=255&h,l+=String.fromCharCode(i,j,k)}return l},AuthenticationContext.prototype._decodeJwt=function(a){if(this._isEmpty(a))return null;var b=/^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/,c=b.exec(a);return!c||c.length<4?(this.warn(\"The returned id_token is not parseable.\"),null):{header:c[1],JWSPayload:c[2],JWSSig:c[3]}},AuthenticationContext.prototype._convertUrlSafeToRegularBase64EncodedString=function(a){return a.replace(\"-\",\"+\").replace(\"_\",\"/\")},AuthenticationContext.prototype._serialize=function(a,b,c){var d=[];if(null!==b){d.push(\"?response_type=\"+a),d.push(\"client_id=\"+encodeURIComponent(b.clientId)),c&&d.push(\"resource=\"+encodeURIComponent(c)),d.push(\"redirect_uri=\"+encodeURIComponent(b.redirectUri)),d.push(\"state=\"+encodeURIComponent(b.state)),b.hasOwnProperty(\"slice\")&&d.push(\"slice=\"+encodeURIComponent(b.slice)),b.hasOwnProperty(\"extraQueryParameter\")&&d.push(b.extraQueryParameter);var e=b.correlationId?b.correlationId:this._guid();d.push(\"client-request-id=\"+encodeURIComponent(e))}return d.join(\"&\")},AuthenticationContext.prototype._deserialize=function(a){var b,c=/\\+/g,d=/([^&=]+)=([^&]*)/g,e=function(a){return decodeURIComponent(a.replace(c,\" \"))},f={};for(b=d.exec(a);b;)f[e(b[1])]=e(b[2]),b=d.exec(a);return f},AuthenticationContext.prototype._decimalToHex=function(a){for(var b=a.toString(16);b.length<2;)b=\"0\"+b;return b},AuthenticationContext.prototype._guid=function(){var a=window.crypto||window.msCrypto;if(a&&a.getRandomValues){var b=new Uint8Array(16);return a.getRandomValues(b),b[6]|=64,b[6]&=79,b[8]|=128,b[8]&=191,this._decimalToHex(b[0])+this._decimalToHex(b[1])+this._decimalToHex(b[2])+this._decimalToHex(b[3])+\"-\"+this._decimalToHex(b[4])+this._decimalToHex(b[5])+\"-\"+this._decimalToHex(b[6])+this._decimalToHex(b[7])+\"-\"+this._decimalToHex(b[8])+this._decimalToHex(b[9])+\"-\"+this._decimalToHex(b[10])+this._decimalToHex(b[11])+this._decimalToHex(b[12])+this._decimalToHex(b[13])+this._decimalToHex(b[14])+this._decimalToHex(b[15])}for(var c=\"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\",d=\"0123456789abcdef\",e=0,f=\"\",g=0;g<36;g++)\"-\"!==c[g]&&\"4\"!==c[g]&&(e=16*Math.random()|0),\"x\"===c[g]?f+=d[e]:\"y\"===c[g]?(e&=3,e|=8,f+=d[e]):f+=c[g];return f},AuthenticationContext.prototype._expiresIn=function(a){return a||(a=3599),this._now()+parseInt(a,10)},AuthenticationContext.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},AuthenticationContext.prototype._addAdalFrame=function(a){if(void 0!==a){this.info(\"Add adal frame to document:\"+a);var b=document.getElementById(a);if(!b){if(document.createElement&&document.documentElement&&(window.opera||-1===window.navigator.userAgent.indexOf(\"MSIE 5.0\"))){var c=document.createElement(\"iframe\");c.setAttribute(\"id\",a),c.setAttribute(\"aria-hidden\",\"true\"),c.style.visibility=\"hidden\",c.style.position=\"absolute\",c.style.width=c.style.height=c.borderWidth=\"0px\",b=document.getElementsByTagName(\"body\")[0].appendChild(c)}else document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML(\"beforeEnd\",'');window.frames&&window.frames[a]&&(b=window.frames[a])}return b}},AuthenticationContext.prototype._saveItem=function(a,b,c){if(this.config&&this.config.cacheLocation&&\"localStorage\"===this.config.cacheLocation){if(!this._supportsLocalStorage())return this.info(\"Local storage is not supported\"),!1;if(c){var d=this._getItem(a)||\"\";localStorage.setItem(a,d+b+this.CONSTANTS.CACHE_DELIMETER)}else localStorage.setItem(a,b);return!0}return this._supportsSessionStorage()?(sessionStorage.setItem(a,b),!0):(this.info(\"Session storage is not supported\"),!1)},AuthenticationContext.prototype._getItem=function(a){return this.config&&this.config.cacheLocation&&\"localStorage\"===this.config.cacheLocation?this._supportsLocalStorage()?localStorage.getItem(a):(this.info(\"Local storage is not supported\"),null):this._supportsSessionStorage()?sessionStorage.getItem(a):(this.info(\"Session storage is not supported\"),null)},AuthenticationContext.prototype._supportsLocalStorage=function(){try{return!!window.localStorage&&(window.localStorage.setItem(\"storageTest\",\"A\"),\"A\"==window.localStorage.getItem(\"storageTest\")&&(window.localStorage.removeItem(\"storageTest\"),!window.localStorage.getItem(\"storageTest\")))}catch(a){return!1}},AuthenticationContext.prototype._supportsSessionStorage=function(){try{return!!window.sessionStorage&&(window.sessionStorage.setItem(\"storageTest\",\"A\"),\"A\"==window.sessionStorage.getItem(\"storageTest\")&&(window.sessionStorage.removeItem(\"storageTest\"),!window.sessionStorage.getItem(\"storageTest\")))}catch(a){return!1}},AuthenticationContext.prototype._cloneConfig=function(a){if(null===a||\"object\"!=typeof a)return a;var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},AuthenticationContext.prototype._addLibMetadata=function(){return\"&x-client-SKU=Js&x-client-Ver=\"+this._libVersion()},AuthenticationContext.prototype.log=function(a,b,c,d){if(a<=Logging.level){if(!Logging.piiLoggingEnabled&&d)return;var e=(new Date).toUTCString(),f=\"\";f=this.config.correlationId?e+\":\"+this.config.correlationId+\"-\"+this._libVersion()+\"-\"+this.CONSTANTS.LEVEL_STRING_MAP[a]+\" \"+b:e+\":\"+this._libVersion()+\"-\"+this.CONSTANTS.LEVEL_STRING_MAP[a]+\" \"+b,c&&(f+=\"\\nstack:\\n\"+c.stack),Logging.log(f)}},AuthenticationContext.prototype.error=function(a,b){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,a,b)},AuthenticationContext.prototype.warn=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,a,null)},AuthenticationContext.prototype.info=function(a){\r\nthis.log(this.CONSTANTS.LOGGING_LEVEL.INFO,a,null)},AuthenticationContext.prototype.verbose=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,a,null)},AuthenticationContext.prototype.errorPii=function(a,b){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,a,b,!0)},AuthenticationContext.prototype.warnPii=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,a,null,!0)},AuthenticationContext.prototype.infoPii=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,a,null,!0)},AuthenticationContext.prototype.verbosePii=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,a,null,!0)},AuthenticationContext.prototype._libVersion=function(){return\"1.0.17\"},\"undefined\"!=typeof module&&module.exports&&(module.exports=AuthenticationContext,module.exports.inject=function(a){return new AuthenticationContext(a)}),AuthenticationContext}();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/adal-angular/dist/adal.min.js\n// module id = 15\n// module chunks = 0","export var StringMatchOption;\r\n(function (StringMatchOption) {\r\n StringMatchOption[StringMatchOption[\"StartsWith\"] = 0] = \"StartsWith\";\r\n StringMatchOption[StringMatchOption[\"ExactMatch\"] = 1] = \"ExactMatch\";\r\n})(StringMatchOption || (StringMatchOption = {}));\r\nexport var ChangedItemType;\r\n(function (ChangedItemType) {\r\n ChangedItemType[ChangedItemType[\"Unknown\"] = 0] = \"Unknown\";\r\n ChangedItemType[ChangedItemType[\"Term\"] = 1] = \"Term\";\r\n ChangedItemType[ChangedItemType[\"TermSet\"] = 2] = \"TermSet\";\r\n ChangedItemType[ChangedItemType[\"Group\"] = 3] = \"Group\";\r\n ChangedItemType[ChangedItemType[\"TermStore\"] = 4] = \"TermStore\";\r\n ChangedItemType[ChangedItemType[\"Site\"] = 5] = \"Site\";\r\n})(ChangedItemType || (ChangedItemType = {}));\r\nexport var ChangedOperationType;\r\n(function (ChangedOperationType) {\r\n ChangedOperationType[ChangedOperationType[\"Unknown\"] = 0] = \"Unknown\";\r\n ChangedOperationType[ChangedOperationType[\"Add\"] = 1] = \"Add\";\r\n ChangedOperationType[ChangedOperationType[\"Edit\"] = 2] = \"Edit\";\r\n ChangedOperationType[ChangedOperationType[\"DeleteObject\"] = 3] = \"DeleteObject\";\r\n ChangedOperationType[ChangedOperationType[\"Move\"] = 4] = \"Move\";\r\n ChangedOperationType[ChangedOperationType[\"Copy\"] = 5] = \"Copy\";\r\n ChangedOperationType[ChangedOperationType[\"PathChange\"] = 6] = \"PathChange\";\r\n ChangedOperationType[ChangedOperationType[\"Merge\"] = 7] = \"Merge\";\r\n ChangedOperationType[ChangedOperationType[\"ImportObject\"] = 8] = \"ImportObject\";\r\n ChangedOperationType[ChangedOperationType[\"Restore\"] = 9] = \"Restore\";\r\n})(ChangedOperationType || (ChangedOperationType = {}));\r\n//# sourceMappingURL=types.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/packages/sp-taxonomy/es5/src/types.js\n// module id = 16\n// module chunks = 0"],"sourceRoot":""}