text: /**
    * The page context represents contextual information about the SharePoint page that
    * is currently being viewed, such as its site URL, the client-side application ID,
    * the current user, etc.  The page context objects themselves represent key information
    * that is needed e.g. to identify the site/web/list/listitem in a REST service call,
    * but it is not a full cache with invalidation and change notifications.
  
    * @alpha
    */
  var SharePointPageContextDataProvider = /** @class */ (function () {
      function SharePointPageContextDataProvider() {
      }
      /**
       * Populates the webPart pageContext using the data from the app Page Context. AppPageContext
       * must be populated already.
       * @internal
       */
      SharePointPageContextDataProvider._createPageContextData = function (spPageContextInfo) {
          var pageContextData = {
              aadInfo: !!spPageContextInfo.aadInstanceUrl && !!spPageContextInfo.aadTenantId && !!spPageContextInfo.aadUserId
                  ? {
                      instanceUrl: spPageContextInfo.aadInstanceUrl,
                      tenantId: spPageContextInfo.aadTenantId,
                      userId: spPageContextInfo.aadUserId
                  }
                  : undefined,
              cultureInfo: {
                  currentCultureName: spPageContextInfo.currentCultureName,
                  currentUICultureName: spPageContextInfo.currentUICultureName,
                  isRightToLeft: document.documentElement.dir === 'rtl' ? true : false
              },
              list: spPageContextInfo.listId && spPageContextInfo.listId !== ''
                  ? {
                      baseTemplate: spPageContextInfo.listBaseTemplate,
                      id: spPageContextInfo.listId,
                      permissions: spPageContextInfo.listPermsMask,
                      serverRelativeUrl: spPageContextInfo.listUrl,
                      title: spPageContextInfo.listTitle
                  }
                  : undefined,
              listItem: spPageContextInfo.pageItemId && spPageContextInfo.pageItemId !== -1
                  ? {
                      id: spPageContextInfo.pageItemId
                  }
                  : undefined,
              page: spPageContextInfo.socialBarEnabled
                  ? {
                      socialBarEnabled: spPageContextInfo.socialBarEnabled
                  }
                  : {},
              site: {
                  absoluteUrl: spPageContextInfo.siteAbsoluteUrl,
                  cdnPrefix: spPageContextInfo.cdnPrefix,
                  classification: spPageContextInfo.siteClassification,
                  correlationId: spPageContextInfo.CorrelationId,
                  group: spPageContextInfo.groupId && spPageContextInfo.groupId !== ''
                      ? {
                          id: spPageContextInfo.groupId,
                          type: spPageContextInfo.groupType
                      }
                      : undefined,
                  id: spPageContextInfo.siteId,
                  isNoScriptEnabled: spPageContextInfo.isNoScriptEnabled,
                  recycleBinItemCount: spPageContextInfo.RecycleBinItemCount,
                  serverRelativeUrl: spPageContextInfo.siteServerRelativeUrl,
                  serverRequestPath: spPageContextInfo.serverRequestPath,
                  sitePagesEnabled: spPageContextInfo.sitePagesEnabled
              },
              user: {
                  isAnonymousGuestUser: spPageContextInfo.isAnonymousGuestUser,
                  isExternalGuestUser: spPageContextInfo.isExternalGuestUser,
                  displayName: spPageContextInfo.userDisplayName,
                  email: spPageContextInfo.userEmail,
                  loginName: spPageContextInfo.userLoginName,
                  preferUserTimeZone: spPageContextInfo.preferUserTimeZone,
                  timeZoneInfo: spPageContextInfo.userTimeZoneData
                      ? {
                          daylightDate: spPageContextInfo.userTimeZoneData.DaylightDate,
                          daylightOffset: spPageContextInfo.userTimeZoneData.DaylightBias,
                          description: spPageContextInfo.userTimeZoneData.Description,
                          id: spPageContextInfo.userTimeZoneData.Id,
                          offset: spPageContextInfo.userTimeZoneData.Bias,
                          standardDate: spPageContextInfo.userTimeZoneData.StandardDate,
                          standardOffset: spPageContextInfo.userTimeZoneData.StandardBias
                      }
                      : undefined,
                  // Server returns null if firstDayOfWeek setting is not configured or user doesn't have permission to access.
                  firstDayOfWeek: spPageContextInfo.userFirstDayOfWeek || undefined
              },
              web: {
                  absoluteUrl: spPageContextInfo.webAbsoluteUrl,
                  id: spPageContextInfo.webId,
                  isAppWeb: spPageContextInfo.isAppWeb,
                  language: spPageContextInfo.webLanguage,
                  languageName: spPageContextInfo.webLanguageName,
                  logoUrl: spPageContextInfo.webLogoUrl,
                  permissions: spPageContextInfo.webPermMasks,
                  serverRelativeUrl: spPageContextInfo.webServerRelativeUrl,
                  templateName: spPageContextInfo.webTemplate,
                  description: spPageContextInfo.webDescription,
                  timeZoneInfo: spPageContextInfo.webTimeZoneData
                      ? {
                          daylightDate: spPageContextInfo.webTimeZoneData.DaylightDate,
                          daylightOffset: spPageContextInfo.webTimeZoneData.DaylightBias,
                          description: spPageContextInfo.webTimeZoneData.Description,
                          id: spPageContextInfo.webTimeZoneData.Id,
                          offset: spPageContextInfo.webTimeZoneData.Bias,
                          standardDate: spPageContextInfo.webTimeZoneData.StandardDate,
                          standardOffset: spPageContextInfo.webTimeZoneData.StandardBias
                      }
                      : undefined,
                  // Server returns null if firstDayOfWeek setting is not configured or user doesn't have permission to access.
                  firstDayOfWeek: spPageContextInfo.webFirstDayOfWeek || undefined,
                  title: spPageContextInfo.webTitle
              },
              featureInfo: spPageContextInfo.featureInfo
          };
          pageContextData.site.sitePagesFeatureVersion = spPageContextInfo.sitePagesFeatureVersion;
          return pageContextData;
      };
      return SharePointPageContextDataProvider;
  }());
  export default SharePointPageContextDataProvider;
  //# sourceMappingURL=SharePointPageContextDataProvider.js.map