@mkody/twitch-emoticons 2.9.6 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +530 -169
- package/dist/TwitchEmoticons.cjs +950 -0
- package/dist/TwitchEmoticons.esm.min.js +7 -0
- package/dist/TwitchEmoticons.esm.min.js.map +7 -0
- package/dist/TwitchEmoticons.min.js +2 -20
- package/dist/TwitchEmoticons.min.js.map +4 -4
- package/package.json +99 -72
- package/src/index.js +38 -12
- package/src/struct/BTTVEmote.js +72 -74
- package/src/struct/Channel.js +48 -48
- package/src/struct/Emote.js +71 -71
- package/src/struct/EmoteFetcher.js +358 -322
- package/src/struct/EmoteParser.js +95 -84
- package/src/struct/EmoteTypeMapper.js +9 -9
- package/src/struct/FFZEmote.js +91 -93
- package/src/struct/SevenTVEmote.js +88 -90
- package/src/struct/TwitchEmote.js +72 -71
- package/src/util/Collection.js +69 -55
- package/src/util/Constants.js +30 -30
- package/typings/index.d.cts +254 -0
- package/typings/index.d.ts +216 -99
- package/.jsdoc.json +0 -46
- package/.nvmrc +0 -1
- package/docs/BTTVEmote.html +0 -1532
- package/docs/Channel.html +0 -824
- package/docs/Collection.html +0 -798
- package/docs/Emote.html +0 -832
- package/docs/EmoteFetcher.html +0 -3741
- package/docs/EmoteParser.html +0 -1187
- package/docs/FFZEmote.html +0 -1686
- package/docs/SevenTVEmote.html +0 -1596
- package/docs/TwitchEmote.html +0 -1528
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -978
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -1049
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/index.html +0 -233
- package/docs/scripts/collapse.js +0 -39
- package/docs/scripts/commonNav.js +0 -28
- package/docs/scripts/linenumber.js +0 -25
- package/docs/scripts/nav.js +0 -12
- package/docs/scripts/polyfill.js +0 -4
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docs/scripts/prettify/lang-css.js +0 -2
- package/docs/scripts/prettify/prettify.js +0 -28
- package/docs/scripts/search.js +0 -99
- package/docs/struct_BTTVEmote.js.html +0 -162
- package/docs/struct_Channel.js.html +0 -132
- package/docs/struct_Emote.js.html +0 -159
- package/docs/struct_EmoteFetcher.js.html +0 -429
- package/docs/struct_EmoteParser.js.html +0 -172
- package/docs/struct_FFZEmote.js.html +0 -185
- package/docs/struct_SevenTVEmote.js.html +0 -180
- package/docs/struct_TwitchEmote.js.html +0 -159
- package/docs/styles/jsdoc.css +0 -776
- package/docs/styles/prettify.css +0 -80
- package/docs/util_Collection.js.html +0 -151
- package/eslint.config.mjs +0 -215
- package/jest.config.js +0 -198
- package/test/BTTV.test.js +0 -48
- package/test/FFZ.test.js +0 -71
- package/test/SevenTV.test.js +0 -71
- package/test/ToFromObject.test.js +0 -156
- package/test/Twitch.test.js +0 -64
- package/test/__snapshots__/ToFromObject.test.js.snap +0 -121
- package/test/other.test.js +0 -72
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/.pnpm/@d-fischer+detect-node@3.0.1/node_modules/@d-fischer/detect-node/browser.js", "../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js", "../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js", "../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js", "../src/struct/Emote.js", "../src/util/Constants.js", "../src/struct/BTTVEmote.js", "../src/util/Collection.js", "../src/struct/Channel.js", "../src/struct/FFZEmote.js", "../src/struct/SevenTVEmote.js", "../src/struct/TwitchEmote.js", "../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/client/ApiClient.js", "../node_modules/.pnpm/@d-fischer+logger@4.2.4/node_modules/@d-fischer/logger/es/createLogger.mjs", "../node_modules/.pnpm/@d-fischer+logger@4.2.4/node_modules/@d-fischer/logger/es/LogLevel.mjs", "../node_modules/.pnpm/@d-fischer+shared-utils@3.6.4/node_modules/@d-fischer/shared-utils/es/decorators/Enumerable.mjs", "../node_modules/.pnpm/@d-fischer+shared-utils@3.6.4/node_modules/@d-fischer/shared-utils/es/functions/array/flatten.mjs", "../node_modules/.pnpm/@d-fischer+shared-utils@3.6.4/node_modules/@d-fischer/shared-utils/es/functions/object/arrayToObject.mjs", "../node_modules/.pnpm/@d-fischer+shared-utils@3.6.4/node_modules/@d-fischer/shared-utils/es/functions/object/indexBy.mjs", "../node_modules/.pnpm/@d-fischer+shared-utils@3.6.4/node_modules/@d-fischer/shared-utils/es/functions/optional/mapOptional.mjs", "../node_modules/.pnpm/@d-fischer+shared-utils@3.6.4/node_modules/@d-fischer/shared-utils/es/functions/promise/withResolvers.mjs", "../node_modules/.pnpm/@d-fischer+logger@4.2.4/node_modules/@d-fischer/logger/es/BaseLogger.mjs", "../node_modules/.pnpm/@d-fischer+logger@4.2.4/node_modules/@d-fischer/logger/es/getMinLogLevelFromEnv.mjs", "../node_modules/.pnpm/@d-fischer+logger@4.2.4/node_modules/@d-fischer/logger/es/BrowserLogger.mjs", "../node_modules/.pnpm/@d-fischer+logger@4.2.4/node_modules/@d-fischer/logger/es/CustomLoggerWrapper.mjs", "../node_modules/.pnpm/@d-fischer+logger@4.2.4/node_modules/@d-fischer/logger/es/NodeLogger.mjs", "../node_modules/.pnpm/@d-fischer+rate-limiter@1.1.0/node_modules/@d-fischer/rate-limiter/es/errors/CustomError.mjs", "../node_modules/.pnpm/@d-fischer+rate-limiter@1.1.0/node_modules/@d-fischer/rate-limiter/es/errors/RateLimiterDestroyedError.mjs", "../node_modules/.pnpm/@d-fischer+rate-limiter@1.1.0/node_modules/@d-fischer/rate-limiter/es/errors/RateLimitReachedError.mjs", "../node_modules/.pnpm/@d-fischer+rate-limiter@1.1.0/node_modules/@d-fischer/rate-limiter/es/errors/RetryAfterError.mjs", "../node_modules/.pnpm/@d-fischer+rate-limiter@1.1.0/node_modules/@d-fischer/rate-limiter/es/limiters/ResponseBasedRateLimiter.mjs", "../node_modules/.pnpm/@d-fischer+rate-limiter@1.1.0/node_modules/@d-fischer/rate-limiter/es/limiters/PartitionedRateLimiter.mjs", "../node_modules/.pnpm/@d-fischer+rate-limiter@1.1.0/node_modules/@d-fischer/rate-limiter/es/limiters/PartitionedTimeBasedRateLimiter.mjs", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/DataObject.js", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/mockApiPort.js", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/qs.js", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/errors/CustomError.js", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/errors/RelationAssertionError.js", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/relations.js", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/rtfm.js", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/extensions/HelixExtension.js", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/errors/HellFreezesOverError.js", "../node_modules/.pnpm/@twurple+common@8.0.3/node_modules/@twurple/common/lib/userResolvers.js", "../node_modules/.pnpm/@twurple+api-call@8.0.3/node_modules/@twurple/api-call/lib/errors/HttpStatusCodeError.js", "../node_modules/.pnpm/@twurple+api-call@8.0.3/node_modules/@twurple/api-call/lib/helpers/transform.js", "../node_modules/.pnpm/@twurple+api-call@8.0.3/node_modules/@twurple/api-call/lib/helpers/url.js", "../node_modules/.pnpm/@twurple+api-call@8.0.3/node_modules/@twurple/api-call/lib/apiCall.js", "../node_modules/.pnpm/@twurple+api-call@8.0.3/node_modules/@twurple/api-call/lib/helpers/queries.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/errors/ConfigError.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/utils/HelixRateLimiter.js", "../node_modules/.pnpm/@d-fischer+cache-decorators@4.0.1/node_modules/@d-fischer/cache-decorators/es/utils/createCacheKey.mjs", "../node_modules/.pnpm/@d-fischer+cache-decorators@4.0.1/node_modules/@d-fischer/cache-decorators/es/decorators/Cacheable.mjs", "../node_modules/.pnpm/@d-fischer+cache-decorators@4.0.1/node_modules/@d-fischer/cache-decorators/es/decorators/CachedGetter.mjs", "../node_modules/.pnpm/@d-fischer+typed-event-emitter@3.3.3/node_modules/@d-fischer/typed-event-emitter/es/Listener.mjs", "../node_modules/.pnpm/@d-fischer+typed-event-emitter@3.3.3/node_modules/@d-fischer/typed-event-emitter/es/EventEmitter.mjs", "../node_modules/.pnpm/@twurple+auth@8.0.3/node_modules/@twurple/auth/lib/AccessToken.js", "../node_modules/.pnpm/@twurple+auth@8.0.3/node_modules/@twurple/auth/lib/errors/InvalidTokenError.js", "../node_modules/.pnpm/@twurple+auth@8.0.3/node_modules/@twurple/auth/lib/helpers.external.js", "../node_modules/.pnpm/@twurple+auth@8.0.3/node_modules/@twurple/auth/lib/TokenInfo.js", "../node_modules/.pnpm/@twurple+auth@8.0.3/node_modules/@twurple/auth/lib/helpers.js", "../node_modules/.pnpm/@twurple+auth@8.0.3/node_modules/@twurple/auth/lib/TokenFetcher.js", "../node_modules/.pnpm/@twurple+auth@8.0.3/node_modules/@twurple/auth/lib/providers/AppTokenAuthProvider.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/client/BaseApiClient.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/bits.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/BaseApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/bits/HelixBitsLeaderboardEntry.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/bits/HelixBitsLeaderboard.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/bits/HelixCheermoteList.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/bits/HelixBitsApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/channel.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/generic.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/relations/HelixUserRelation.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/utils/HelixRequestBatcher.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/utils/pagination/HelixPaginatedRequest.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/utils/pagination/HelixPaginatedRequestWithTotal.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/utils/pagination/HelixPaginatedResult.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/utils/pagination/HelixPagination.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channel/HelixChannel.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channel/HelixChannelEditor.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channel/HelixChannelFollower.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channel/HelixFollowedChannel.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channel/HelixAdSchedule.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channel/HelixSnoozeNextAdResult.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channel/HelixChannelApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/channelPoints.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channelPoints/HelixCustomReward.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channelPoints/HelixCustomRewardRedemption.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channelPoints/HelixChannelPointsApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/charity/HelixCharityCampaignAmount.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/charity/HelixCharityCampaign.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/charity/HelixCharityCampaignDonation.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/charity/HelixCharityApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/errors/ChatMessageDroppedError.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/chat.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/shared-chat-session.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixEmoteBase.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixEmote.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixChannelEmote.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixChatBadgeVersion.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixChatBadgeSet.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixChatChatter.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixChatSettings.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixEmoteFromSet.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixPrivilegedChatSettings.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixSentChatMessage.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixSharedChatSessionParticipant.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixSharedChatSession.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixUserEmote.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/chat/HelixChatApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/clip.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/clip/HelixClip.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/clip/HelixClipApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/contentClassificationLabels/HelixContentClassificationLabel.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/contentClassificationLabels/HelixContentClassificationLabelApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/entitlement.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/entitlements/HelixDropsEntitlement.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/entitlements/HelixEntitlementApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/eventSub.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/eventSub/HelixEventSubSubscription.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/eventSub/HelixPaginatedEventSubSubscriptionsRequest.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/eventSub/HelixEventSubConduit.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/eventSub/HelixEventSubConduitShard.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/eventSub/HelixEventSubApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/extensions.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/channel/HelixChannelReference.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/extensions/HelixExtensionBitsProduct.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/extensions/HelixExtensionTransaction.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/extensions/HelixExtensionsApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/game/HelixGame.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/game/HelixGameApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/goals/HelixGoal.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/goals/HelixGoalApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/hypeTrain/HelixHypeTrainContribution.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/hypeTrain/HelixHypeTrain.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/hypeTrain/HelixHypeTrainAllTimeHigh.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/hypeTrain/HelixHypeTrainStatus.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/hypeTrain/HelixHypeTrainApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/moderation.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixAutoModSettings.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixAutoModStatus.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixBanUser.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixBan.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixBlockedTerm.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixModeratedChannel.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixModerator.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixShieldModeStatus.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixUnbanRequest.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixWarning.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/moderation/HelixModerationApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/poll.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/poll/HelixPollChoice.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/poll/HelixPoll.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/poll/HelixPollApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/prediction.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/prediction/HelixPredictor.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/prediction/HelixPredictionOutcome.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/prediction/HelixPrediction.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/prediction/HelixPredictionApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/raid.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/raids/HelixRaid.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/raids/HelixRaidApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/schedule.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/schedule/HelixScheduleSegment.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/schedule/HelixPaginatedScheduleSegmentRequest.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/schedule/HelixSchedule.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/schedule/HelixScheduleApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/search.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/search/HelixChannelSearchResult.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/search/HelixSearchApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/errors/StreamNotLiveError.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/stream.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/stream/HelixStream.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/stream/HelixStreamMarker.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/stream/HelixStreamMarkerWithVideo.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/stream/HelixStreamApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/subscription.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/subscriptions/HelixUserSubscription.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/subscriptions/HelixSubscription.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/subscriptions/HelixPaginatedSubscriptionsRequest.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/subscriptions/HelixSubscriptionApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/team/HelixTeam.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/team/HelixTeamWithUsers.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/team/HelixTeamApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/user.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/user/extensions/HelixBaseExtension.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/user/extensions/HelixInstalledExtension.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/user/extensions/HelixInstalledExtensionList.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/user/extensions/HelixUserExtension.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/user/HelixUser.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/user/HelixPrivilegedUser.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/user/HelixUserBlock.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/user/HelixUserApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/video/HelixVideo.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/video/HelixVideoApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/interfaces/endpoints/whisper.external.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/endpoints/whisper/HelixWhisperApi.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/reporting/ApiReportedRequest.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/client/NoContextApiClient.js", "../node_modules/.pnpm/@twurple+api@8.0.3_@twurple+auth@8.0.3/node_modules/@twurple/api/lib/client/UserContextApiClient.js", "../src/struct/EmoteFetcher.js", "../src/struct/EmoteParser.js", "../src/index.js"],
|
|
4
|
+
"sourcesContent": ["module.exports.isNode = false;\n\n", "function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n", "var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n", "module.exports = require('./lib/retry');", "class Emote {\n /**\n * Base class for emotes.\n * This constructor is not to be used.\n * @param {Channel} channel - Channel this emote belongs to.\n * @param {string} id - ID of the emote.\n * @param {data} data - The raw emote data.\n * @throws {Error} When trying to use the base Emote class directly.\n */\n constructor (channel, id, data) {\n if (new.target.name === Emote.name) {\n throw new Error('Base Emote class cannot be used')\n }\n\n /**\n * The emote fetcher.\n * @type {EmoteFetcher}\n */\n this.fetcher = channel.fetcher\n\n /**\n * The channel this emote belongs to.\n * Only accurate and constant on Twitch emotes.\n * For other types of emotes, use the `owner` or `ownerName` property.\n * @type {Channel}\n */\n this.channel = channel\n\n /**\n * The ID of this emote.\n * @type {string}\n */\n this.id = id\n\n /**\n * The type of this emote.\n * Either `twitch`, `bttv`, `ffz`, or '7tv'.\n * @type {string | null}\n */\n this.type = null\n\n this._setup(data)\n }\n\n _setup (data) {\n /**\n * The code or name of the emote.\n * @type {string}\n */\n this.code = data.code\n }\n\n /**\n * Gets the image link of the emote.\n * @param {number} size - The size of the image.\n * @returns {string} - The URL to the emote.\n */\n /* c8 ignore next 3 */\n toLink () {\n return null\n }\n\n /**\n * Override for `toString`.\n * Will give the emote's name.\n * @returns {string} - The emote code.\n */\n /* c8 ignore next 3 */\n toString () {\n return this.code\n }\n\n /**\n * Override for `toObject`.\n * Will result in an Object representation of an Emote\n * @returns {object} - Object representation of the Emote.\n */\n toObject () {\n return {\n code: this.code,\n id: this.id,\n channel_id: this.channel.channel_id,\n }\n }\n}\n\nexport default Emote\n", "export default {\n Twitch: {\n CDN: (id, size = 0, forceStatic = false, theme = 'dark') => `https://static-cdn.jtvnw.net/emoticons/v2/${id}/${forceStatic ? 'static' : 'default'}/${theme}/${size + 1}.0`,\n },\n BTTV: {\n Global: 'https://api.betterttv.net/3/cached/emotes/global',\n Channel: (id) => `https://api.betterttv.net/3/cached/users/twitch/${id}`,\n CDN: (id, size = 0, forceStatic = false) => `https://cdn.betterttv.net/emote/${id}/${size + 1}x.${forceStatic ? 'png' : 'webp'}`,\n },\n SevenTV: {\n Global: 'https://7tv.io/v3/emote-sets/global',\n Channel: (id) => `https://7tv.io/v3/users/twitch/${id}`,\n CDN: (id, format, size = 1, forceStatic = false) => `https://cdn.7tv.app/emote/${id}/${size}x${forceStatic ? '_static' : ''}.${format}`,\n },\n FFZ: {\n sets: {\n Global: 3,\n Modifiers: 1532818,\n },\n Set: (id) => `https://api.frankerfacez.com/v1/set/${id}`,\n Channel: (id) => `https://api.frankerfacez.com/v1/room/id/${id}`,\n CDN: (id, size = 1) => `https://cdn.frankerfacez.com/emote/${id}/${size}`,\n CDNAnimated: (id, size = 1) => `https://cdn.frankerfacez.com/emote/${id}/animated/${size}.webp`,\n },\n Templates: {\n html: '<img alt=\"{name}\" title=\"{name}\" class=\"twitch-emote\" src=\"{link}\">',\n markdown: '',\n bbcode: '[img]{link}[/img]',\n plain: '{link}',\n },\n}\n", "import Emote from './Emote.js'\nimport Constants from '../util/Constants.js'\n\n/** @augments Emote */\nclass BTTVEmote extends Emote {\n /**\n * A BTTV emote.\n * @param {Channel} channel - Channel this emote belongs to.\n * @param {string} id - ID of the emote.\n * @param {data} data - The raw emote data.\n */\n constructor (channel, id, data) {\n super(channel, id, data)\n this.type = 'bttv'\n }\n\n _setup (data) {\n super._setup(data)\n\n /**\n * The name of the emote creator's channel.\n * Will be null for global or channel emotes.\n * @type {?string}\n */\n this.ownerName = 'user' in data ? data.user.name : null\n\n /**\n * If emote is animated.\n * @type {boolean}\n */\n this.animated = data.animated\n\n /**\n * The image type of the emote.\n * @type {string}\n */\n this.imageType = 'webp'\n }\n\n /**\n * Gets the image link of the emote.\n * @param {object} [options] - Options for the link.\n * @param {number} [options.size=0] - Size (scale) for the emote.\n * @param {boolean} [options.forceStatic] - Whether to force the emote to be static (non-animated). Defaults to the fetcher's forceStatic or `false`.\n * @returns {string} - The URL to the emote.\n */\n toLink (options) {\n const {\n size = 0,\n forceStatic = this.fetcher.forceStatic || false,\n } = options || {}\n\n return Constants.BTTV.CDN(this.id, size, forceStatic)\n }\n\n /**\n * Override for `toObject`.\n * Will result in an Object representation of a BTTVEmote\n * @returns {object} - Object representation of the BTTVEmote.\n */\n toObject () {\n return {\n ...super.toObject(),\n animated: this.animated,\n ownerName: this.ownerName,\n type: this.type,\n }\n }\n\n /**\n * Converts an emote Object into a BTTVEmote\n * @param {object} [emoteObject] - Object representation of this emote\n * @param {Channel} [channel] - Channel this emote belongs to.\n * @returns {BTTVEmote} - A BTTVEmote instance.\n */\n static fromObject (emoteObject, channel) {\n return new BTTVEmote(channel, emoteObject.id,\n {\n code: emoteObject.code,\n animated: emoteObject.animated,\n user: {\n name: emoteObject.ownerName,\n },\n })\n }\n}\n\nexport default BTTVEmote\n", "/* eslint-disable jsdoc/reject-function-type, jsdoc/reject-any-type */\n/**\n * An extended Map with utility methods.\n * @class Collection\n */\nclass Collection extends Map {\n /**\n * Finds first matching value by property or function.\n * Same as `Array#find`.\n * @param {string|Function} propOrFunc - Property or function to test.\n * @param {any} [value] - Value to find.\n * @returns {any|null} - The found item or null if none found.\n */\n find (propOrFunc, value) {\n if (typeof propOrFunc === 'string') {\n if (value === undefined) {\n return null\n }\n\n for (const item of this.values()) {\n if (item[propOrFunc] === value) {\n return item\n }\n }\n\n return null\n }\n\n if (typeof propOrFunc === 'function') {\n let i = 0\n for (const item of this.values()) {\n if (propOrFunc(item, i, this)) {\n return item\n }\n i++\n }\n\n return null\n }\n\n return null\n }\n\n /**\n * Filters cache by function.\n * Same as `Array#filter`.\n * @param {Function} func - Function to test.\n * @param {any} [thisArg] - The context for the function.\n * @returns {Collection} - A new collection with the filtered items.\n */\n filter (func, thisArg) {\n if (thisArg) {\n func = func.bind(thisArg)\n }\n\n const results = new this.constructor()\n\n let i = 0\n for (const [key, item] of this) {\n if (func(item, i, this)) {\n results.set(key, item)\n }\n i++\n }\n\n return results\n }\n\n /**\n * Maps cache by function.\n * Same as `Array#map`.\n * @param {Function} func - Function to use.\n * @param {any} [thisArg] - The context for the function.\n * @returns {any[]} - An array with the mapped items.\n */\n map (func, thisArg) {\n if (thisArg) {\n func = func.bind(thisArg)\n }\n\n const array = new Array(this.size)\n\n let i = 0\n for (const item of this.values()) {\n array[i] = func(item, i, this)\n i++\n }\n\n return array\n }\n}\n\nexport default Collection\n", "import Collection from '../util/Collection.js'\n\nclass Channel {\n /**\n * A Twitch channel.\n * @param {EmoteFetcher} fetcher - The emote fetcher.\n * @param {number} id - ID of the channel.\n */\n constructor (fetcher, id) {\n /**\n * The emote fetcher.\n * @type {EmoteFetcher}\n */\n this.fetcher = fetcher\n\n /**\n * The ID of this channel.\n * For the global channel, the ID will be null.\n * @type {?number}\n */\n this.channel_id = id || null\n\n /**\n * Cached emotes belonging to this channel.\n * @type {Collection<string, Emote>}\n */\n this.emotes = new Collection()\n }\n\n /* There are tests that those are returning Collections, but c8 doesn't get it. */\n /* c8 ignore start */\n\n /**\n * Fetches the BTTV emotes for this channel.\n * @returns {Promise<Collection<string, BTTVEmote>>} - A promise that resolves to a collection of BTTVEmotes.\n */\n fetchBTTVEmotes () {\n return this.fetcher.fetchBTTVEmotes(this.id)\n }\n\n /**\n * Fetches the FFZ emotes for this channel.\n * @returns {Promise<Collection<string, FFZEmote>>} - A promise that resolves to a collection of FFZEmotes.\n */\n fetchFFZEmotes () {\n return this.fetcher.fetchFFZEmotes(this.id)\n }\n\n /**\n * Fetches the 7TV emotes for this channel.\n * @returns {Promise<Collection<string, SevenTVEmote>>} - A promise that resolves to a collection of SevenTVEmotes.\n */\n fetchSevenTVEmotes () {\n return this.fetcher.fetchSevenTVEmotes(this.id)\n }\n\n /* c8 ignore end */\n}\n\nexport default Channel\n", "import Emote from './Emote.js'\nimport Constants from '../util/Constants.js'\n\n/** @augments Emote */\nclass FFZEmote extends Emote {\n /**\n * An FFZ emote.\n * @param {Channel} channel - Channel this emote belongs to.\n * @param {string} id - ID of the emote.\n * @param {data} data - The raw emote data.\n */\n constructor (channel, id, data) {\n super(channel, id, data)\n this.type = 'ffz'\n }\n\n _setup (data) {\n super._setup(data)\n this.code = data.name\n\n /**\n * The name of the emote creator's channel.\n * @type {?string}\n */\n this.ownerName = 'owner' in data ? data.owner.name : null\n\n /**\n * Available image sizes.\n * @type {string[]}\n */\n this.sizes = 'animated' in data ? Object.keys(data.animated) : Object.keys(data.urls)\n\n /**\n * If emote is animated.\n * @type {boolean}\n */\n this.animated = 'animated' in data\n\n /**\n * The image type of the emote.\n * @type {string}\n */\n this.imageType = 'animated' in data ? 'webp' : 'png'\n\n /**\n * If the emote is a modifier and should be hidden.\n * @type {boolean}\n */\n this.modifier = data.modifier && (data.modifier_flags & 1) !== 0\n }\n\n /**\n * Gets the image link of the emote.\n * @param {object} [options] - Options for the link.\n * @param {number} [options.size=0] - Size (scale) for the emote.\n * @param {boolean} [options.forceStatic] - Whether to force the emote to be static (non-animated). Defaults to the fetcher's forceStatic or `false`.\n * @returns {string} - The URL to the emote.\n */\n toLink (options) {\n const {\n size = 0,\n forceStatic = this.fetcher.forceStatic || false,\n } = options || {}\n\n const sizeKey = this.sizes[size]\n if (this.animated && !forceStatic) return Constants.FFZ.CDNAnimated(this.id, sizeKey)\n return Constants.FFZ.CDN(this.id, sizeKey)\n }\n\n /**\n * Override for `toObject`.\n * Will result in an Object representation of a FFZEmote\n * @returns {object} - Object representation of the FFZEmote.\n */\n toObject () {\n return {\n ...super.toObject(),\n animated: this.animated,\n sizes: this.sizes,\n ownerName: this.ownerName,\n type: this.type,\n modifier: this.modifier,\n }\n }\n\n /**\n * Converts an emote Object into a FFZEmote\n * @param {object} [emoteObject] - Object representation of this emote\n * @param {Channel} [channel] - Channel this emote belongs to.\n * @returns {FFZEmote} - A FFZEmote instance.\n */\n static fromObject (emoteObject, channel) {\n // Need to convert sizes array to object, e.g. [1, 2, 4] -> { 1: '1', 2: '2', 4: '4' }\n const sizesObj = emoteObject.sizes.reduce((acc, curr) => {\n acc[curr] = curr\n return acc\n }, {})\n return new FFZEmote(channel, emoteObject.id,\n {\n code: emoteObject.code,\n name: emoteObject.code,\n urls: sizesObj,\n ...emoteObject.animated ? { animated: sizesObj } : {},\n owner: { name: emoteObject.ownerName },\n modifier: emoteObject.modifier,\n modifier_flags: emoteObject.modifier,\n })\n }\n}\n\nexport default FFZEmote\n", "import Emote from './Emote.js'\nimport Constants from '../util/Constants.js'\n\n/** @augments Emote */\nclass SevenTVEmote extends Emote {\n /**\n * A 7TV emote.\n * @param {Channel} channel - Channel this emote belongs to.\n * @param {string} id - ID of the emote.\n * @param {data} data - The raw emote data.\n */\n constructor (channel, id, data) {\n super(channel, id, data)\n this.type = '7tv'\n }\n\n _setup (data) {\n super._setup(data)\n this.code = data.name\n\n /**\n * The name of the emote creator's channel.\n * @type {?string}\n */\n this.ownerName = 'owner' in data.data ? data.data.owner.display_name : null\n\n /**\n * Available image sizes.\n * @type {string[]}\n */\n this.sizes = data.data.host.files\n .filter((el) => el.format === this.channel.format.toUpperCase())\n .map((el) => el.name.replace(/x\\.(\\w+)/, ''))\n\n /**\n * If emote is animated.\n * @type {boolean}\n */\n this.animated = data.data.animated\n\n /**\n * The image type of the emote.\n * @type {string}\n */\n this.imageType = this.channel.format\n }\n\n /**\n * Gets the image link of the emote.\n * @param {object} [options] - Options for the link.\n * @param {number} [options.size=0] - Size (scale) for the emote.\n * @param {boolean} [options.forceStatic] - Whether to force the emote to be static (non-animated). Defaults to the fetcher's forceStatic or `false`.\n * @returns {string} - The URL to the emote.\n */\n toLink (options) {\n const {\n size = 0,\n forceStatic = this.fetcher.forceStatic || false,\n } = options || {}\n\n const sizeKey = this.sizes[size]\n return Constants.SevenTV.CDN(this.id, this.imageType, sizeKey, forceStatic)\n }\n\n /**\n * Override for `toObject`.\n * Will result in an Object representation of a SevenTVEmote\n * @returns {object} - Object representation of the SevenTVEmote.\n */\n toObject () {\n return {\n ...super.toObject(),\n animated: this.animated,\n sizes: this.sizes,\n ownerName: this.ownerName,\n type: this.type,\n imageType: this.imageType,\n }\n }\n\n /**\n * Converts an emote Object into a SevenTVEmote\n * @param {object} [emoteObject] - Object representation of this emote\n * @param {Channel} [channel] - Channel this emote belongs to.\n * @returns {SevenTVEmote} - A SevenTVEmote instance.\n */\n static fromObject (emoteObject, channel) {\n const sizes = emoteObject.sizes.map((size) => { return { format: channel.format.toUpperCase(), name: size } })\n return new SevenTVEmote(channel, emoteObject.id,\n {\n code: emoteObject.code,\n name: emoteObject.code,\n data: {\n animated: emoteObject.animated,\n owner: {\n display_name: emoteObject.ownerName,\n },\n host: {\n files: sizes,\n },\n },\n })\n }\n}\n\nexport default SevenTVEmote\n", "import Emote from './Emote.js'\nimport Constants from '../util/Constants.js'\n\n/** @augments Emote */\nclass TwitchEmote extends Emote {\n /**\n * A Twitch emote.\n * @param {Channel} channel - Channel this emote belongs to.\n * @param {string} id - ID of the emote.\n * @param {data} data - The raw emote data.\n */\n constructor (channel, id, data) {\n super(channel, id, data)\n this.type = 'twitch'\n }\n\n _setup (data) {\n super._setup(data)\n\n /**\n * The set ID of the emote.\n * @type {?string}\n */\n this.set = data.emoticon_set\n\n /**\n * If emote is animated.\n * @type {boolean}\n */\n this.animated = 'animated' in data.formats\n\n /**\n * The image type of the emote.\n * @type {string}\n */\n this.imageType = 'animated' in data.formats ? 'gif' : 'png'\n }\n\n /**\n * Gets the image link of the emote.\n * @param {object} [options] - Options for the link.\n * @param {number} [options.size=0] - Size (scale) for the emote.\n * @param {boolean} [options.forceStatic] - Whether to force the emote to be static (non-animated). Defaults to the fetcher's forceStatic or `false`.\n * @param {'dark' | 'light'} [options.themeMode] - Only for Twitch: the preferred theme mode. Defaults to the fetcher's twitchThemeMode or `dark`.\n * @returns {string} - The URL to the emote.\n */\n toLink (options) {\n const {\n size = 0,\n forceStatic = this.fetcher.forceStatic || false,\n themeMode = this.fetcher.twitchThemeMode || 'dark',\n } = options || {}\n\n return Constants.Twitch.CDN(this.id, size, forceStatic, themeMode)\n }\n\n /**\n * Override for `toObject`.\n * Will result in an Object representation of a TwitchEmote\n * @returns {object} - Object representation of the TwitchEmote.\n */\n toObject () {\n return {\n ...super.toObject(),\n animated: this.animated,\n set: this.set,\n type: this.type,\n }\n }\n\n /**\n * Converts an emote Object into a TwitchEmote\n * @param {object} [emoteObject] - Object representation of this emote\n * @param {Channel} [channel] - Channel this emote belongs to.\n * @returns {TwitchEmote} - A TwitchEmote instance.\n */\n static fromObject (emoteObject, channel) {\n return new TwitchEmote(channel, emoteObject.id,\n {\n code: emoteObject.code,\n animated: emoteObject.animated,\n emoticon_set: emoteObject.set,\n formats: emoteObject.animated ? { animated: emoteObject.animated } : {},\n })\n }\n}\n\nexport default TwitchEmote\n", "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n", "import { __decorate } from \"tslib\";\nimport { isNode } from '@d-fischer/detect-node';\nimport { createLogger } from '@d-fischer/logger';\nimport { PartitionedRateLimiter, PartitionedTimeBasedRateLimiter } from '@d-fischer/rate-limiter';\nimport { callTwitchApiRaw } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { ConfigError } from '../errors/ConfigError.js';\nimport { HelixRateLimiter } from '../utils/HelixRateLimiter.js';\nimport { BaseApiClient } from './BaseApiClient.js';\nimport { NoContextApiClient } from './NoContextApiClient.js';\nimport { UserContextApiClient } from './UserContextApiClient.js';\n/**\n * An API client for the Twitch Helix API and other miscellaneous endpoints.\n *\n * @meta category main\n * @hideProtected\n */\nlet ApiClient = class ApiClient extends BaseApiClient {\n /**\n * Creates a new API client instance.\n *\n * @param config Configuration for the client instance.\n */\n constructor(config) {\n if (!config.authProvider) {\n throw new ConfigError('No auth provider given. Please supply the `authProvider` option.');\n }\n const rateLimitLoggerOptions = { name: 'twurple:api:rate-limiter', ...config.logger };\n super(config, createLogger({ name: 'twurple:api:client', ...config.logger }), isNode\n ? new PartitionedRateLimiter({\n getPartitionKey: req => req.userId ?? null,\n createChild: () => new HelixRateLimiter({ logger: rateLimitLoggerOptions }),\n })\n : new PartitionedTimeBasedRateLimiter({\n logger: rateLimitLoggerOptions,\n bucketSize: 800,\n timeFrame: 64000,\n doRequest: async ({ options, clientId, accessToken, authorizationType, fetchOptions, }) => await callTwitchApiRaw(options, clientId, accessToken, authorizationType, fetchOptions),\n getPartitionKey: req => req.userId ?? null,\n }));\n }\n /**\n * Creates a contextualized ApiClient that can be used to call the API in the context of a given user.\n *\n * @param user The user to use as context.\n * @param runner The callback to execute.\n *\n * A parameter is passed that should be used in place of the normal `ApiClient`\n * to ensure that all requests are executed in the given user's context.\n *\n * Please note that requests which require scope authorization ignore this context.\n *\n * The return value of your callback will be propagated to the return value of this method.\n */\n async asUser(user, runner) {\n const ctx = new UserContextApiClient(this._config, this._logger, this._rateLimiter, extractUserId(user));\n return await runner(ctx);\n }\n /**\n * Creates a contextualized ApiClient that can be used to call the API in the context of a given intent.\n *\n * @param intents A list of intents. The first one that is found in your auth provider will be used.\n * @param runner The callback to execute.\n *\n * A parameter is passed that should be used in place of the normal `ApiClient`\n * to ensure that all requests are executed in the given user's context.\n *\n * Please note that requests which require scope authorization ignore this context.\n *\n * The return value of your callback will be propagated to the return value of this method.\n */\n async asIntent(intents, runner) {\n if (!this._authProvider.getAccessTokenForIntent) {\n throw new Error('Trying to use intents with an auth provider that does not support them');\n }\n for (const intent of intents) {\n const user = await this._authProvider.getAccessTokenForIntent(intent);\n if (user) {\n const ctx = new UserContextApiClient(this._config, this._logger, this._rateLimiter, user.userId);\n return await runner(ctx);\n }\n }\n throw new Error(`Intents [${intents.join(', ')}] not found in auth provider`);\n }\n /**\n * Creates a contextualized ApiClient that can be used to call the API without the context of any user.\n *\n * This usually means that an app access token is used.\n *\n * @param runner The callback to execute.\n *\n * A parameter is passed that should be used in place of the normal `ApiClient`\n * to ensure that all requests are executed without user context.\n *\n * Please note that requests which require scope authorization ignore this context erasure.\n *\n * The return value of your callback will be propagated to the return value of this method.\n */\n async withoutUser(runner) {\n const ctx = new NoContextApiClient(this._config, this._logger, this._rateLimiter);\n return await runner(ctx);\n }\n};\nApiClient = __decorate([\n rtfm('api', 'ApiClient')\n], ApiClient);\nexport { ApiClient };\n", "import { isNode } from '@d-fischer/detect-node';\nimport { BrowserLogger } from \"./BrowserLogger.mjs\";\nimport { CustomLoggerWrapper } from \"./CustomLoggerWrapper.mjs\";\nimport { NodeLogger } from \"./NodeLogger.mjs\";\nexport function createLogger(options) {\n if (options.custom) {\n return new CustomLoggerWrapper(options);\n }\n if (isNode) {\n return new NodeLogger(options);\n }\n return new BrowserLogger(options);\n}\n", "var _a;\nimport { isNode } from '@d-fischer/detect-node';\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"CRITICAL\"] = 0] = \"CRITICAL\";\n LogLevel[LogLevel[\"ERROR\"] = 1] = \"ERROR\";\n LogLevel[LogLevel[\"WARNING\"] = 2] = \"WARNING\";\n LogLevel[LogLevel[\"INFO\"] = 3] = \"INFO\";\n LogLevel[LogLevel[\"DEBUG\"] = 4] = \"DEBUG\";\n LogLevel[LogLevel[\"TRACE\"] = 7] = \"TRACE\";\n})(LogLevel || (LogLevel = {}));\nexport function resolveLogLevel(level) {\n if (typeof level === 'number') {\n if (Object.prototype.hasOwnProperty.call(LogLevel, level)) {\n return level;\n }\n var eligibleLevels = Object.keys(LogLevel)\n .map(function (k) { return parseInt(k, 10); })\n .filter(function (k) { return !isNaN(k) && k < level; });\n if (!eligibleLevels.length) {\n return LogLevel.WARNING;\n }\n return Math.max.apply(Math, eligibleLevels);\n }\n // TODO drop the replace for next major, it keeps the old deprecated debug1/2/3 levels running\n var strLevel = level.replace(/\\d+$/, '').toUpperCase();\n if (!Object.prototype.hasOwnProperty.call(LogLevel, strLevel)) {\n throw new Error(\"Unknown log level string: \".concat(level));\n }\n return LogLevel[strLevel];\n}\n// Node 8+ defines console.debug as noop, and earlier versions don't define it at all\nvar debugFunction = isNode ? console.log.bind(console) : console.debug.bind(console);\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport var LogLevelToConsoleFunction = (_a = {},\n _a[LogLevel.CRITICAL] = console.error.bind(console),\n _a[LogLevel.ERROR] = console.error.bind(console),\n _a[LogLevel.WARNING] = console.warn.bind(console),\n _a[LogLevel.INFO] = console.info.bind(console),\n _a[LogLevel.DEBUG] = debugFunction.bind(console),\n _a[LogLevel.TRACE] = console.trace.bind(console),\n _a);\n", "/* eslint-disable @typescript-eslint/naming-convention */\nexport function Enumerable(enumerable) {\n if (enumerable === void 0) { enumerable = true; }\n return function (target, key) {\n // first property defined in prototype, that's why we use getters/setters\n // (otherwise assignment in object will override property in prototype)\n Object.defineProperty(target, key, {\n get: function () {\n return;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set: function (val) {\n // here we have a reference to the instance and can set property directly to it\n Object.defineProperty(this, key, {\n value: val,\n writable: true,\n enumerable: enumerable\n });\n },\n enumerable: enumerable\n });\n };\n}\n", "import { __read, __spreadArray } from \"tslib\";\nexport function flatten(arr) {\n var _a;\n return (_a = []).concat.apply(_a, __spreadArray([], __read(arr), false));\n}\n", "import { __read, __spreadArray } from \"tslib\";\nexport function arrayToObject(arr, fn) {\n return Object.assign.apply(Object, __spreadArray([{}], __read(arr.map(fn)), false));\n}\n", "import { arrayToObject } from \"./arrayToObject.mjs\";\nexport function indexBy(arr, keyFn) {\n if (typeof keyFn !== 'function') {\n var key_1 = keyFn;\n // eslint-disable-next-line @typescript-eslint/ban-types,@typescript-eslint/no-base-to-string\n keyFn = (function (value) { return value[key_1].toString(); });\n }\n return arrayToObject(arr, function (val) {\n var _a;\n return (_a = {}, _a[keyFn(val)] = val, _a);\n });\n}\n", "export function isNullish(value) {\n return value == null;\n}\nexport function mapNullable(value, cb) {\n return isNullish(value) ? null : cb(value);\n}\nexport function mapOptional(value, cb) {\n return isNullish(value) ? undefined : cb(value);\n}\n", "export function promiseWithResolvers() {\n // eslint-disable-next-line @typescript-eslint/init-declarations\n var resolve;\n // eslint-disable-next-line @typescript-eslint/init-declarations\n var reject;\n var promise = new Promise(function (_resolve, _reject) {\n resolve = _resolve;\n reject = _reject;\n });\n return { promise: promise, resolve: resolve, reject: reject };\n}\n", "import { mapOptional } from '@d-fischer/shared-utils';\nimport { isNode } from '@d-fischer/detect-node';\nimport { getMinLogLevelFromEnv } from \"./getMinLogLevelFromEnv.mjs\";\nimport { LogLevel, resolveLogLevel } from \"./LogLevel.mjs\";\nvar BaseLogger = /** @class */ (function () {\n function BaseLogger(_a) {\n var name = _a.name, minLevel = _a.minLevel, _b = _a.emoji, emoji = _b === void 0 ? false : _b, colors = _a.colors, _c = _a.timestamps, timestamps = _c === void 0 ? isNode : _c;\n var _d, _e;\n this._name = name;\n this._minLevel =\n (_e = (_d = mapOptional(minLevel, function (lv) { return resolveLogLevel(lv); })) !== null && _d !== void 0 ? _d : getMinLogLevelFromEnv(name)) !== null && _e !== void 0 ? _e : LogLevel.WARNING;\n this._emoji = emoji;\n this._colors = colors;\n this._timestamps = timestamps;\n }\n // region convenience methods\n BaseLogger.prototype.crit = function (message) {\n this.log(LogLevel.CRITICAL, message);\n };\n BaseLogger.prototype.error = function (message) {\n this.log(LogLevel.ERROR, message);\n };\n BaseLogger.prototype.warn = function (message) {\n this.log(LogLevel.WARNING, message);\n };\n BaseLogger.prototype.info = function (message) {\n this.log(LogLevel.INFO, message);\n };\n BaseLogger.prototype.debug = function (message) {\n this.log(LogLevel.DEBUG, message);\n };\n BaseLogger.prototype.trace = function (message) {\n this.log(LogLevel.TRACE, message);\n };\n return BaseLogger;\n}());\nexport { BaseLogger };\n", "var _a, _b;\nimport { resolveLogLevel } from \"./LogLevel.mjs\";\nvar data = typeof process === 'undefined'\n ? []\n : (_b = (_a = process.env.LOGGING) === null || _a === void 0 ? void 0 : _a.split(';').map(function (part) {\n var _a = part.split('=', 2), namespace = _a[0], strLevel = _a[1];\n if (strLevel) {\n return [namespace === 'default' ? undefined : namespace.split(':'), resolveLogLevel(strLevel)];\n }\n return null;\n }).filter(function (v) { return !!v; }).sort(function (_a, _b) {\n var _c, _d;\n var a = _a[0];\n var b = _b[0];\n return ((_c = b === null || b === void 0 ? void 0 : b.length) !== null && _c !== void 0 ? _c : 0) - ((_d = a === null || a === void 0 ? void 0 : a.length) !== null && _d !== void 0 ? _d : 0);\n })) !== null && _b !== void 0 ? _b : [];\nvar defaultIndex = data.findIndex(function (_a) {\n var nsParts = _a[0];\n return !nsParts;\n});\nvar defaultLevel = undefined;\nif (defaultIndex !== -1) {\n defaultLevel = data[defaultIndex][1];\n data.splice(defaultIndex);\n}\nfunction isPrefix(value, prefix) {\n return prefix.length <= value.length && prefix.every(function (item, i) { return item === value[i]; });\n}\nexport function getMinLogLevelFromEnv(name) {\n var nameSplit = name.split(':');\n for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {\n var _a = data_1[_i], nsParts = _a[0], level = _a[1];\n if (isPrefix(nameSplit, nsParts)) {\n return level;\n }\n }\n return defaultLevel;\n}\n", "import { __extends } from \"tslib\";\nimport { LogLevelToConsoleFunction } from \"./LogLevel.mjs\";\nimport { BaseLogger } from \"./BaseLogger.mjs\";\nvar BrowserLogger = /** @class */ (function (_super) {\n __extends(BrowserLogger, _super);\n function BrowserLogger() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BrowserLogger.prototype.log = function (level, message) {\n if (level > this._minLevel) {\n return;\n }\n var logFn = LogLevelToConsoleFunction[level];\n var formattedMessage = \"[\".concat(this._name, \"] \").concat(message);\n if (this._timestamps) {\n formattedMessage = \"[\".concat(new Date().toISOString(), \"] \").concat(message);\n }\n logFn(formattedMessage);\n };\n return BrowserLogger;\n}(BaseLogger));\nexport { BrowserLogger };\n", "import { mapOptional } from '@d-fischer/shared-utils';\nimport { getMinLogLevelFromEnv } from \"./getMinLogLevelFromEnv.mjs\";\nimport { LogLevel, resolveLogLevel } from \"./LogLevel.mjs\";\nvar CustomLoggerWrapper = /** @class */ (function () {\n function CustomLoggerWrapper(_a) {\n var name = _a.name, minLevel = _a.minLevel, custom = _a.custom;\n var _b;\n this._minLevel = (_b = mapOptional(minLevel, function (lv) { return resolveLogLevel(lv); })) !== null && _b !== void 0 ? _b : getMinLogLevelFromEnv(name);\n this._override = typeof custom === 'function' ? { log: custom } : custom;\n }\n CustomLoggerWrapper.prototype.log = function (level, message) {\n if (this._shouldLog(level)) {\n this._override.log(level, message);\n }\n };\n CustomLoggerWrapper.prototype.crit = function (message) {\n if (!this._override.crit) {\n this.log(LogLevel.CRITICAL, message);\n }\n else if (this._shouldLog(LogLevel.CRITICAL)) {\n this._override.crit(message);\n }\n };\n CustomLoggerWrapper.prototype.error = function (message) {\n if (!this._override.error) {\n this.log(LogLevel.ERROR, message);\n }\n else if (this._shouldLog(LogLevel.ERROR)) {\n this._override.error(message);\n }\n };\n CustomLoggerWrapper.prototype.warn = function (message) {\n if (!this._override.warn) {\n this.log(LogLevel.WARNING, message);\n }\n else if (this._shouldLog(LogLevel.WARNING)) {\n this._override.warn(message);\n }\n };\n CustomLoggerWrapper.prototype.info = function (message) {\n if (!this._override.info) {\n this.log(LogLevel.INFO, message);\n }\n else if (this._shouldLog(LogLevel.INFO)) {\n this._override.info(message);\n }\n };\n CustomLoggerWrapper.prototype.debug = function (message) {\n if (!this._override.debug) {\n this.log(LogLevel.DEBUG, message);\n }\n else if (this._shouldLog(LogLevel.DEBUG)) {\n this._override.debug(message);\n }\n };\n CustomLoggerWrapper.prototype.trace = function (message) {\n if (!this._override.trace) {\n this.log(LogLevel.TRACE, message);\n }\n else if (this._shouldLog(LogLevel.TRACE)) {\n this._override.trace(message);\n }\n };\n CustomLoggerWrapper.prototype._shouldLog = function (level) {\n return this._minLevel === undefined || this._minLevel >= level;\n };\n return CustomLoggerWrapper;\n}());\nexport { CustomLoggerWrapper };\n", "var _a, _b, _c;\nimport { __extends } from \"tslib\";\nimport { LogLevel, LogLevelToConsoleFunction } from \"./LogLevel.mjs\";\nimport { BaseLogger } from \"./BaseLogger.mjs\";\nexport var LogLevelToEmoji = (_a = {},\n _a[LogLevel.CRITICAL] = \"\\uD83D\\uDED1\",\n _a[LogLevel.ERROR] = \"\\u274C\",\n // these following two need extra spaces at the end because somehow they consume less space in a terminal than they should...\n _a[LogLevel.WARNING] = \"\\u26A0\\uFE0F \",\n _a[LogLevel.INFO] = \"\\u2139\\uFE0F \",\n _a[LogLevel.DEBUG] = \"\\uD83D\\uDC1E\",\n _a[LogLevel.TRACE] = \"\\uD83D\\uDC3E\",\n _a);\nvar colors = {\n black: 30,\n red: 31,\n green: 32,\n yellow: 33,\n blue: 34,\n magenta: 35,\n cyan: 36,\n white: 37,\n blackBright: 90,\n redBright: 91,\n greenBright: 92,\n yellowBright: 93,\n blueBright: 94,\n magentaBright: 95,\n cyanBright: 96,\n whiteBright: 97\n};\nvar bgColors = {\n bgBlack: 40,\n bgRed: 41,\n bgGreen: 42,\n bgYellow: 43,\n bgBlue: 44,\n bgMagenta: 45,\n bgCyan: 46,\n bgWhite: 47,\n bgBlackBright: 100,\n bgRedBright: 101,\n bgGreenBright: 102,\n bgYellowBright: 103,\n bgBlueBright: 104,\n bgMagentaBright: 105,\n bgCyanBright: 106,\n bgWhiteBright: 107\n};\nfunction createGenericWrapper(color, ending, inner) {\n return function (str) { return \"\\u001B[\".concat(color, \"m\").concat(inner ? inner(str) : str, \"\\u001B[\").concat(ending, \"m\"); };\n}\nfunction createColorWrapper(color) {\n return createGenericWrapper(colors[color], 39);\n}\nfunction createBgWrapper(color, fgWrapper) {\n return createGenericWrapper(bgColors[color], 49, fgWrapper);\n}\nexport var LogLevelToColor = (_b = {},\n _b[LogLevel.CRITICAL] = createColorWrapper('red'),\n _b[LogLevel.ERROR] = createColorWrapper('redBright'),\n _b[LogLevel.WARNING] = createColorWrapper('yellow'),\n _b[LogLevel.INFO] = createColorWrapper('blue'),\n _b[LogLevel.DEBUG] = createColorWrapper('magenta'),\n _b[LogLevel.TRACE] = createGenericWrapper(0, 0),\n _b);\nexport var LogLevelToBackgroundColor = (_c = {},\n _c[LogLevel.CRITICAL] = createBgWrapper('bgRed', createColorWrapper('white')),\n _c[LogLevel.ERROR] = createBgWrapper('bgRedBright', createColorWrapper('white')),\n _c[LogLevel.WARNING] = createBgWrapper('bgYellow', createColorWrapper('black')),\n _c[LogLevel.INFO] = createBgWrapper('bgBlue', createColorWrapper('white')),\n _c[LogLevel.DEBUG] = createBgWrapper('bgMagenta', createColorWrapper('black')),\n _c[LogLevel.TRACE] = createGenericWrapper(7, 27),\n _c);\nvar NodeLogger = /** @class */ (function (_super) {\n __extends(NodeLogger, _super);\n function NodeLogger() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NodeLogger.prototype.log = function (level, message) {\n var _a, _b, _c;\n if (level > this._minLevel) {\n return;\n }\n var logFn = LogLevelToConsoleFunction[level];\n var builtMessage = '';\n if (this._timestamps) {\n builtMessage += \"[\".concat(new Date().toISOString(), \"] \");\n }\n if (this._emoji) {\n var emoji = LogLevelToEmoji[level];\n builtMessage += \"\".concat(emoji, \" \");\n }\n var useColors = (_c = (_a = this._colors) !== null && _a !== void 0 ? _a : (_b = process.stdout) === null || _b === void 0 ? void 0 : _b.isTTY) !== null && _c !== void 0 ? _c : true;\n if (useColors) {\n builtMessage += \"\".concat(LogLevelToBackgroundColor[level](this._name), \" \").concat(LogLevelToBackgroundColor[level](LogLevel[level]), \" \").concat(LogLevelToColor[level](message));\n }\n else {\n builtMessage += \"[\".concat(this._name, \":\").concat(LogLevel[level].toLowerCase(), \"] \").concat(message);\n }\n logFn(builtMessage);\n };\n return NodeLogger;\n}(BaseLogger));\nexport { NodeLogger };\n", "/** @private */\nexport class CustomError extends Error {\n constructor(...params) {\n var _a;\n // @ts-ignore\n super(...params);\n // restore prototype chain\n Object.setPrototypeOf(this, new.target.prototype);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n (_a = Error.captureStackTrace) === null || _a === void 0 ? void 0 : _a.call(Error, this, new.target.constructor);\n }\n get name() {\n return this.constructor.name;\n }\n}\n", "import { CustomError } from \"./CustomError.mjs\";\nexport class RateLimiterDestroyedError extends CustomError {\n}\n", "import { CustomError } from \"./CustomError.mjs\";\nexport class RateLimitReachedError extends CustomError {\n}\n", "import { CustomError } from \"./CustomError.mjs\";\nexport class RetryAfterError extends CustomError {\n constructor(after) {\n super(`Need to retry after ${after} ms`);\n this._retryAt = Date.now() + after;\n }\n get retryAt() {\n return this._retryAt;\n }\n}\n", "import { createLogger } from '@d-fischer/logger';\nimport { mapNullable } from '@d-fischer/shared-utils';\nimport { RateLimitReachedError } from \"../errors/RateLimitReachedError.mjs\";\nimport { RetryAfterError } from \"../errors/RetryAfterError.mjs\";\nexport class ResponseBasedRateLimiter {\n constructor({ logger }) {\n this._queue = [];\n this._batchRunning = false;\n this._paused = false;\n this._logger = createLogger({ name: 'rate-limiter', emoji: true, ...logger });\n }\n async request(req, options) {\n this._logger.trace('request start');\n return await new Promise((resolve, reject) => {\n var _a;\n const reqSpec = {\n req,\n resolve,\n reject,\n limitReachedBehavior: (_a = options === null || options === void 0 ? void 0 : options.limitReachedBehavior) !== null && _a !== void 0 ? _a : 'enqueue'\n };\n if (this._batchRunning || !!this._nextBatchTimer || this._paused) {\n this._logger.trace(`request queued batchRunning:${this._batchRunning.toString()} hasNextBatchTimer:${(!!this\n ._nextBatchTimer).toString()} paused:${this._paused.toString()}`);\n this._queue.push(reqSpec);\n }\n else {\n void this._runRequestBatch([reqSpec]);\n }\n });\n }\n clear() {\n this._queue = [];\n }\n pause() {\n this._paused = true;\n }\n resume() {\n this._paused = false;\n this._runNextBatch();\n }\n get stats() {\n var _a, _b, _c, _d, _e;\n return {\n lastKnownLimit: (_b = (_a = this._parameters) === null || _a === void 0 ? void 0 : _a.limit) !== null && _b !== void 0 ? _b : null,\n lastKnownRemainingRequests: (_d = (_c = this._parameters) === null || _c === void 0 ? void 0 : _c.remaining) !== null && _d !== void 0 ? _d : null,\n lastKnownResetDate: mapNullable((_e = this._parameters) === null || _e === void 0 ? void 0 : _e.resetsAt, v => new Date(v))\n };\n }\n async _runRequestBatch(reqSpecs) {\n this._logger.trace(`runRequestBatch start specs:${reqSpecs.length}`);\n this._batchRunning = true;\n if (this._parameters) {\n this._logger.debug(`Remaining requests: ${this._parameters.remaining}`);\n }\n this._logger.debug(`Doing ${reqSpecs.length} requests, new queue length is ${this._queue.length}`);\n const promises = reqSpecs.map(async (reqSpec) => {\n const { req, resolve, reject } = reqSpec;\n try {\n const result = await this.doRequest(req);\n const retry = this.needsToRetryAfter(result);\n if (retry !== null) {\n this._queue.unshift(reqSpec);\n this._logger.info(`Retrying after ${retry} ms`);\n throw new RetryAfterError(retry);\n }\n const params = this.getParametersFromResponse(result);\n resolve(result);\n return params;\n }\n catch (e) {\n if (e instanceof RetryAfterError) {\n throw e;\n }\n reject(e);\n return undefined;\n }\n });\n // downleveling problem hack, see https://github.com/es-shims/Promise.allSettled/issues/5\n const settledPromises = await Promise.allSettled(promises);\n const rejectedPromises = settledPromises.filter((p) => p.status === 'rejected');\n const now = Date.now();\n if (rejectedPromises.length) {\n this._logger.trace('runRequestBatch some rejected');\n const retryAt = Math.max(now, ...rejectedPromises.map((p) => p.reason.retryAt));\n const retryAfter = retryAt - now;\n this._logger.warn(`Waiting for ${retryAfter} ms because the rate limit was exceeded`);\n this._nextBatchTimer = setTimeout(() => {\n this._parameters = undefined;\n this._runNextBatch();\n }, retryAfter);\n }\n else {\n this._logger.trace('runRequestBatch none rejected');\n const params = settledPromises\n .filter((p) => p.status === 'fulfilled' && p.value !== undefined)\n .map(p => p.value)\n .reduce((carry, v) => {\n if (!carry) {\n return v;\n }\n // return v.resetsAt > carry.resetsAt ? v : carry;\n return v.remaining < carry.remaining ? v : carry;\n }, undefined);\n this._batchRunning = false;\n if (params) {\n this._parameters = params;\n if (params.resetsAt < now || params.remaining > 0) {\n this._logger.trace('runRequestBatch canRunMore');\n this._runNextBatch();\n }\n else {\n const delay = params.resetsAt - now;\n this._logger.trace(`runRequestBatch delay:${delay}`);\n this._logger.warn(`Waiting for ${delay} ms because the rate limit was reached`);\n this._queue = this._queue.filter(entry => {\n switch (entry.limitReachedBehavior) {\n case 'enqueue': {\n return true;\n }\n case 'null': {\n entry.resolve(null);\n return false;\n }\n case 'throw': {\n entry.reject(new RateLimitReachedError('Request removed from queue because the rate limit was reached'));\n return false;\n }\n default: {\n throw new Error('this should never happen');\n }\n }\n });\n this._nextBatchTimer = setTimeout(() => {\n this._parameters = undefined;\n this._runNextBatch();\n }, delay);\n }\n }\n }\n this._logger.trace('runRequestBatch end');\n }\n _runNextBatch() {\n if (this._paused) {\n return;\n }\n this._logger.trace('runNextBatch start');\n if (this._nextBatchTimer) {\n clearTimeout(this._nextBatchTimer);\n this._nextBatchTimer = undefined;\n }\n const amount = this._parameters ? Math.min(this._parameters.remaining, this._parameters.limit / 10) : 1;\n const reqSpecs = this._queue.splice(0, amount);\n if (reqSpecs.length) {\n void this._runRequestBatch(reqSpecs);\n }\n this._logger.trace('runNextBatch end');\n }\n}\n", "import { ResponseBasedRateLimiter } from \"./ResponseBasedRateLimiter.mjs\";\nexport class PartitionedRateLimiter {\n constructor(options) {\n this._children = new Map();\n this._paused = false;\n this._partitionKeyCallback = options.getPartitionKey;\n this._createChildCallback = options.createChild;\n }\n async request(req, options) {\n const partitionKey = this._partitionKeyCallback(req);\n const partitionChild = this._getChild(partitionKey);\n return await partitionChild.request(req, options);\n }\n clear() {\n for (const child of this._children.values()) {\n child.clear();\n }\n }\n pause() {\n this._paused = true;\n for (const child of this._children.values()) {\n child.pause();\n }\n }\n resume() {\n this._paused = false;\n for (const child of this._children.values()) {\n child.resume();\n }\n }\n getChildStats(partitionKey) {\n if (!this._children.has(partitionKey)) {\n return null;\n }\n const child = this._children.get(partitionKey);\n if (!(child instanceof ResponseBasedRateLimiter)) {\n return null;\n }\n return child.stats;\n }\n _getChild(partitionKey) {\n if (this._children.has(partitionKey)) {\n return this._children.get(partitionKey);\n }\n const result = this._createChildCallback(partitionKey);\n if (this._paused) {\n result.pause();\n }\n this._children.set(partitionKey, result);\n return result;\n }\n}\n", "import { createLogger } from '@d-fischer/logger';\nimport { RateLimitReachedError } from \"../errors/RateLimitReachedError.mjs\";\nimport { RateLimiterDestroyedError } from \"../errors/RateLimiterDestroyedError.mjs\";\nexport class PartitionedTimeBasedRateLimiter {\n constructor({ logger, bucketSize, timeFrame, doRequest, getPartitionKey }) {\n this._partitionedQueue = new Map();\n this._usedFromBucket = new Map();\n this._counterTimers = new Set();\n this._paused = false;\n this._destroyed = false;\n this._logger = createLogger({ name: 'rate-limiter', emoji: true, ...logger });\n this._bucketSize = bucketSize;\n this._timeFrame = timeFrame;\n this._callback = doRequest;\n this._partitionKeyCallback = getPartitionKey;\n }\n async request(req, options) {\n return await new Promise((resolve, reject) => {\n var _a, _b;\n if (this._destroyed) {\n reject(new RateLimiterDestroyedError('Rate limiter was destroyed'));\n return;\n }\n const reqSpec = {\n req,\n resolve,\n reject,\n limitReachedBehavior: (_a = options === null || options === void 0 ? void 0 : options.limitReachedBehavior) !== null && _a !== void 0 ? _a : 'enqueue'\n };\n const partitionKey = this._partitionKeyCallback(req);\n const usedFromBucket = (_b = this._usedFromBucket.get(partitionKey)) !== null && _b !== void 0 ? _b : 0;\n if (usedFromBucket >= this._bucketSize || this._paused) {\n switch (reqSpec.limitReachedBehavior) {\n case 'enqueue': {\n const queue = this._getPartitionedQueue(partitionKey);\n queue.push(reqSpec);\n if (usedFromBucket + queue.length >= this._bucketSize) {\n this._logger.warn(`Rate limit of ${this._bucketSize} for ${partitionKey ? `partition ${partitionKey}` : 'default partition'} was reached, waiting for ${this._paused ? 'the limiter to be unpaused' : 'a free bucket entry'}; queue size is ${queue.length}`);\n }\n else {\n this._logger.info(`Enqueueing request for ${partitionKey ? `partition ${partitionKey}` : 'default partition'} because the rate limiter is paused; queue size is ${queue.length}`);\n }\n break;\n }\n case 'null': {\n reqSpec.resolve(null);\n if (this._paused) {\n this._logger.info(`Returning null for request for ${partitionKey ? `partition ${partitionKey}` : 'default partition'} because the rate limiter is paused`);\n }\n else {\n this._logger.warn(`Rate limit of ${this._bucketSize} for ${partitionKey ? `partition ${partitionKey}` : 'default partition'} was reached, dropping request and returning null`);\n }\n break;\n }\n case 'throw': {\n reqSpec.reject(new RateLimitReachedError(`Request dropped because ${this._paused\n ? 'the rate limiter is paused'\n : `the rate limit for ${partitionKey ? `partition ${partitionKey}` : 'default partition'} was reached`}`));\n break;\n }\n default: {\n throw new Error('this should never happen');\n }\n }\n }\n else {\n void this._runRequest(reqSpec, partitionKey);\n }\n });\n }\n clear() {\n this._partitionedQueue.clear();\n }\n pause() {\n this._paused = true;\n }\n resume() {\n this._paused = false;\n for (const partitionKey of this._partitionedQueue.keys()) {\n this._runNextRequest(partitionKey);\n }\n }\n destroy() {\n this._paused = false;\n this._destroyed = true;\n this._counterTimers.forEach(timer => {\n clearTimeout(timer);\n });\n for (const queue of this._partitionedQueue.values()) {\n for (const req of queue) {\n req.reject(new RateLimiterDestroyedError('Rate limiter was destroyed'));\n }\n }\n this._partitionedQueue.clear();\n }\n _getPartitionedQueue(partitionKey) {\n if (this._partitionedQueue.has(partitionKey)) {\n return this._partitionedQueue.get(partitionKey);\n }\n const newQueue = [];\n this._partitionedQueue.set(partitionKey, newQueue);\n return newQueue;\n }\n async _runRequest(reqSpec, partitionKey) {\n var _a;\n const queue = this._getPartitionedQueue(partitionKey);\n this._logger.debug(`doing a request for ${partitionKey ? `partition ${partitionKey}` : 'default partition'}, new queue length is ${queue.length}`);\n this._usedFromBucket.set(partitionKey, ((_a = this._usedFromBucket.get(partitionKey)) !== null && _a !== void 0 ? _a : 0) + 1);\n const { req, resolve, reject } = reqSpec;\n try {\n resolve(await this._callback(req));\n }\n catch (e) {\n reject(e);\n }\n finally {\n const counterTimer = setTimeout(() => {\n this._counterTimers.delete(counterTimer);\n const newUsed = this._usedFromBucket.get(partitionKey) - 1;\n this._usedFromBucket.set(partitionKey, newUsed);\n if (queue.length && newUsed < this._bucketSize) {\n this._runNextRequest(partitionKey);\n }\n }, this._timeFrame);\n this._counterTimers.add(counterTimer);\n }\n }\n _runNextRequest(partitionKey) {\n if (this._paused) {\n return;\n }\n const queue = this._getPartitionedQueue(partitionKey);\n const reqSpec = queue.shift();\n if (reqSpec) {\n void this._runRequest(reqSpec, partitionKey);\n }\n }\n}\n", "import { klona } from 'klona';\n/** @private */\nexport const rawDataSymbol = Symbol('twurpleRawData');\n/**\n * Gets the raw data of a data object.\n *\n * @param obj The data object to get the raw data of.\n */\nexport function getRawData(obj) {\n return klona(obj[rawDataSymbol]);\n}\n/** @private */\nexport class DataObject {\n /** @private */ [rawDataSymbol];\n /** @private */\n constructor(data) {\n this[rawDataSymbol] = data;\n }\n}\n", "/** @private */\nexport function getMockApiPort() {\n try {\n return process.env.TWURPLE_MOCK_API_PORT ?? null;\n }\n catch {\n try {\n // @ts-ignore\n return import.meta.env.TWURPLE_MOCK_API_PORT ?? null; // eslint-disable-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-member-access\n }\n catch {\n return null;\n }\n }\n}\n", "export function qsStringify(obj) {\n if (!obj) {\n return '';\n }\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(obj)) {\n if (value === null) {\n params.append(key, '');\n }\n else if (Array.isArray(value)) {\n for (const v of value) {\n params.append(key, v.toString());\n }\n }\n else if (value !== undefined) {\n params.append(key, value.toString());\n }\n }\n const result = params.toString();\n return result ? `?${result}` : '';\n}\n", "/** @private */\nexport class CustomError extends Error {\n constructor(message, options) {\n super(message, options);\n // restore prototype chain\n Object.setPrototypeOf(this, new.target.prototype);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n Error.captureStackTrace?.(this, new.target.constructor);\n }\n get name() {\n return this.constructor.name;\n }\n}\n", "import { CustomError } from './CustomError.js';\n/**\n * Thrown when a relation that is expected to never be null does return null.\n */\nexport class RelationAssertionError extends CustomError {\n constructor() {\n super('Relation returned null - this may be a library bug or a race condition in your own code');\n }\n}\n", "import { RelationAssertionError } from './errors/RelationAssertionError.js';\n/** @private */\nexport function checkRelationAssertion(value) {\n if (value == null) {\n throw new RelationAssertionError();\n }\n return value;\n}\n", "/** @private */\nexport function rtfm(pkg, name, idKey) {\n return clazz => {\n const fn = idKey\n ? function () {\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return `[${name}#${this[idKey]} - please check https://twurple.js.org/reference/${pkg}/classes/${name}.html for available properties]`;\n }\n : function () {\n return `[${name} - please check https://twurple.js.org/reference/${pkg}/classes/${name}.html for available properties]`;\n };\n Object.defineProperty(clazz.prototype, Symbol.for('nodejs.util.inspect.custom'), {\n value: fn,\n enumerable: false,\n });\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol } from '../DataObject.js';\nimport { rtfm } from '../rtfm.js';\n/**\n * A Twitch Extension.\n */\nlet HelixExtension = class HelixExtension extends DataObject {\n /**\n * The name of the extension's author.\n */\n get authorName() {\n return this[rawDataSymbol].author_name;\n }\n /**\n * Whether bits are enabled for the extension.\n */\n get bitsEnabled() {\n return this[rawDataSymbol].bits_enabled;\n }\n /**\n * Whether the extension can be installed.\n */\n get installable() {\n return this[rawDataSymbol].can_install;\n }\n /**\n * The location of the extension's configuration.\n */\n get configurationLocation() {\n return this[rawDataSymbol].configuration_location;\n }\n /**\n * The extension's description.\n */\n get description() {\n return this[rawDataSymbol].description;\n }\n /**\n * The URL of the extension's terms of service.\n */\n get tosUrl() {\n return this[rawDataSymbol].eula_tos_url;\n }\n /**\n * Whether the extension has support for sending chat messages.\n */\n get hasChatSupport() {\n return this[rawDataSymbol].has_chat_support;\n }\n /**\n * The URL of the extension's default sized icon.\n */\n get iconUrl() {\n return this[rawDataSymbol].icon_url;\n }\n /**\n * Gets the URL of the extension's icon in the given size.\n *\n * @param size The size of the icon.\n */\n getIconUrl(size) {\n return this[rawDataSymbol].icon_urls[size];\n }\n /**\n * The extension's ID.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The extension's name.\n */\n get name() {\n return this[rawDataSymbol].name;\n }\n /**\n * The URL of the extension's privacy policy.\n */\n get privacyPolicyUrl() {\n return this[rawDataSymbol].privacy_policy_url;\n }\n /**\n * Whether the extension requests its users to share their identity with it.\n */\n get requestsIdentityLink() {\n return this[rawDataSymbol].request_identity_link;\n }\n /**\n * The URLs of the extension's screenshots.\n */\n get screenshotUrls() {\n return this[rawDataSymbol].screenshot_urls;\n }\n /**\n * The extension's activity state.\n */\n get state() {\n return this[rawDataSymbol].state;\n }\n /**\n * The extension's level of support for subscriptions.\n */\n get subscriptionsSupportLevel() {\n return this[rawDataSymbol].subscriptions_support_level;\n }\n /**\n * The extension's feature summary.\n */\n get summary() {\n return this[rawDataSymbol].summary;\n }\n /**\n * The extension's support email address.\n */\n get supportEmail() {\n return this[rawDataSymbol].support_email;\n }\n /**\n * The extension's version.\n */\n get version() {\n return this[rawDataSymbol].version;\n }\n /**\n * The extension's feature summary for viewers.\n */\n get viewerSummary() {\n return this[rawDataSymbol].viewer_summary;\n }\n /**\n * The extension's feature summary for viewers.\n *\n * @deprecated Use `viewerSummary` instead.\n */\n get viewerSummery() {\n return this[rawDataSymbol].viewer_summary;\n }\n /**\n * The extension's allowed configuration URLs.\n */\n get allowedConfigUrls() {\n return this[rawDataSymbol].allowlisted_config_urls;\n }\n /**\n * The extension's allowed panel URLs.\n */\n get allowedPanelUrls() {\n return this[rawDataSymbol].allowlisted_panel_urls;\n }\n /**\n * The URL shown when a viewer opens the extension on a mobile device.\n *\n * If the extension does not have a mobile view, this is null.\n */\n get mobileViewerUrl() {\n return this[rawDataSymbol].views.mobile?.viewer_url ?? null;\n }\n /**\n * The URL shown to the viewer when the extension is shown as a panel.\n *\n * If the extension does not have a panel view, this is null.\n */\n get panelViewerUrl() {\n return this[rawDataSymbol].views.panel?.viewer_url ?? null;\n }\n /**\n * The height of the extension panel.\n *\n * If the extension does not have a panel view, this is null.\n */\n get panelHeight() {\n return this[rawDataSymbol].views.panel?.height ?? null;\n }\n /**\n * Whether the extension can link to external content from its panel view.\n *\n * If the extension does not have a panel view, this is null.\n */\n get panelCanLinkExternalContent() {\n return this[rawDataSymbol].views.panel?.can_link_external_content ?? null;\n }\n /**\n * The URL shown to the viewer when the extension is shown as a video overlay.\n *\n * If the extension does not have a overlay view, this is null.\n */\n get overlayViewerUrl() {\n return this[rawDataSymbol].views.video_overlay?.viewer_url ?? null;\n }\n /**\n * Whether the extension can link to external content from its overlay view.\n *\n * If the extension does not have a overlay view, this is null.\n */\n get overlayCanLinkExternalContent() {\n return this[rawDataSymbol].views.video_overlay?.can_link_external_content ?? null;\n }\n /**\n * The URL shown to the viewer when the extension is shown as a video component.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentViewerUrl() {\n return this[rawDataSymbol].views.component?.viewer_url ?? null;\n }\n /**\n * The aspect width of the extension's component view.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentAspectWidth() {\n return this[rawDataSymbol].views.component?.aspect_width ?? null;\n }\n /**\n * The aspect height of the extension's component view.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentAspectHeight() {\n return this[rawDataSymbol].views.component?.aspect_height ?? null;\n }\n /**\n * The horizontal aspect ratio of the extension's component view.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentAspectRatioX() {\n return this[rawDataSymbol].views.component?.aspect_ratio_x ?? null;\n }\n /**\n * The vertical aspect ratio of the extension's component view.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentAspectRatioY() {\n return this[rawDataSymbol].views.component?.aspect_ratio_y ?? null;\n }\n /**\n * Whether the extension's component view should automatically scale.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentAutoScales() {\n return this[rawDataSymbol].views.component?.autoscale ?? null;\n }\n /**\n * The base width of the extension's component view to use for scaling.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentScalePixels() {\n return this[rawDataSymbol].views.component?.scale_pixels ?? null;\n }\n /**\n * The target height of the extension's component view.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentTargetHeight() {\n return this[rawDataSymbol].views.component?.target_height ?? null;\n }\n /**\n * The size of the extension's component view.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentSize() {\n return this[rawDataSymbol].views.component?.size ?? null;\n }\n /**\n * Whether zooming is enabled for the extension's component view.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentZoom() {\n return this[rawDataSymbol].views.component?.zoom ?? null;\n }\n /**\n * The zoom pixels of the extension's component view.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentZoomPixels() {\n return this[rawDataSymbol].views.component?.zoom_pixels ?? null;\n }\n /**\n * Whether the extension can link to external content from its component view.\n *\n * If the extension does not have a component view, this is null.\n */\n get componentCanLinkExternalContent() {\n return this[rawDataSymbol].views.component?.can_link_external_content ?? null;\n }\n /**\n * The URL shown to the viewer when the extension's configuration page is shown.\n *\n * If the extension does not have a config view, this is null.\n */\n get configViewerUrl() {\n return this[rawDataSymbol].views.config?.viewer_url ?? null;\n }\n /**\n * Whether the extension can link to external content from its config view.\n *\n * If the extension does not have a config view, this is null.\n */\n get configCanLinkExternalContent() {\n return this[rawDataSymbol].views.config?.can_link_external_content ?? null;\n }\n};\nHelixExtension = __decorate([\n rtfm('api', 'HelixExtension', 'id')\n], HelixExtension);\nexport { HelixExtension };\n", "import { CustomError } from './CustomError.js';\n/**\n * These are the kind of errors that should never happen.\n *\n * If you see one thrown, please file a bug in the GitHub issue tracker.\n */\nexport class HellFreezesOverError extends CustomError {\n constructor(message) {\n super(`${message} - this should never happen, please file a bug in the GitHub issue tracker`);\n }\n}\n", "/**\n * Extracts the user ID from an argument that is possibly an object containing that ID.\n *\n * @param user The user ID or object.\n */\nexport function extractUserId(user) {\n if (typeof user === 'string') {\n return user;\n }\n if (typeof user === 'number') {\n return user.toString(10);\n }\n return user.id;\n}\n/**\n * Extracts the username from an argument that is possibly an object containing that name.\n *\n * @param user The username or object.\n */\nexport function extractUserName(user) {\n return typeof user === 'string' ? user : user.name;\n}\n", "import { CustomError } from '@twurple/common';\n/**\n * Thrown whenever a HTTP error occurs. Some HTTP errors are handled in the library when they're expected.\n */\nexport class HttpStatusCodeError extends CustomError {\n _statusCode;\n _url;\n _method;\n _body;\n /** @private */\n constructor(_statusCode, statusText, _url, _method, _body, isJson) {\n super(`Encountered HTTP status code ${_statusCode}: ${statusText}\\n\\nURL: ${_url}\\nMethod: ${_method}\\nBody:\\n${!isJson && _body.length > 150 ? `${_body.slice(0, 147)}...` : _body}`);\n this._statusCode = _statusCode;\n this._url = _url;\n this._method = _method;\n this._body = _body;\n }\n /**\n * The HTTP status code of the error.\n */\n get statusCode() {\n return this._statusCode;\n }\n /**\n * The URL that was requested.\n */\n get url() {\n return this._url;\n }\n /**\n * The HTTP method that was used for the request.\n */\n get method() {\n return this._method;\n }\n /**\n * The body that was used for the request, as a string.\n */\n get body() {\n return this._body;\n }\n}\n", "import { qsStringify } from '@twurple/common';\nimport { HttpStatusCodeError } from '../errors/HttpStatusCodeError.js';\n/** @private */\nexport async function handleTwitchApiResponseError(response, options) {\n if (!response.ok) {\n const isJson = response.headers.get('Content-Type') === 'application/json';\n const text = isJson ? JSON.stringify(await response.json(), null, 2) : await response.text();\n const params = qsStringify(options.query);\n const fullUrl = `${options.url}${params}`;\n throw new HttpStatusCodeError(response.status, response.statusText, fullUrl, options.method ?? 'GET', text, isJson);\n }\n}\n/** @private */\nexport async function transformTwitchApiResponse(response) {\n if (response.status === 204) {\n return undefined; // oof\n }\n const text = await response.text();\n if (!text) {\n return undefined; // mega oof - Twitch doesn't return a response when it should\n }\n return JSON.parse(text);\n}\n", "import { getMockApiPort } from '@twurple/common';\n/** @internal */\nexport function getTwitchApiUrl(url, type) {\n const mockServerPort = getMockApiPort();\n switch (type) {\n case 'helix': {\n const unprefixedUrl = url.replace(/^\\//, '');\n return mockServerPort\n ? unprefixedUrl === 'eventsub/subscriptions'\n ? `http://localhost:${mockServerPort}/${unprefixedUrl}`\n : `http://localhost:${mockServerPort}/mock/${unprefixedUrl}`\n : `https://api.twitch.tv/helix/${unprefixedUrl}`;\n }\n case 'auth': {\n const unprefixedUrl = url.replace(/^\\//, '');\n return mockServerPort\n ? `http://localhost:${mockServerPort}/auth/${unprefixedUrl}`\n : `https://id.twitch.tv/oauth2/${unprefixedUrl}`;\n }\n case 'custom':\n return url;\n default:\n return url; // wat\n }\n}\n", "import { qsStringify } from '@twurple/common';\nimport { handleTwitchApiResponseError, transformTwitchApiResponse } from './helpers/transform.js';\nimport { getTwitchApiUrl } from './helpers/url.js';\n/**\n * Makes a call to the Twitch API using the given credentials, returning the raw Response object.\n *\n * @param options The configuration of the call.\n * @param clientId The client ID of your application.\n * @param accessToken The access token to call the API with.\n *\n * You need to obtain one using one of the [Twitch OAuth flows](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/).\n * @param authorizationType The type of Authorization header to send.\n *\n * Defaults to \"Bearer\" for Helix and \"OAuth\" for everything else.\n * @param fetchOptions Additional options to be passed to the `fetch` function.\n */\nexport async function callTwitchApiRaw(options, clientId, accessToken, authorizationType, fetchOptions = {}) {\n const type = options.type ?? 'helix';\n const url = getTwitchApiUrl(options.url, type);\n const params = qsStringify(options.query);\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const headers = new Headers({ Accept: 'application/json' });\n let body = undefined;\n if (options.jsonBody) {\n body = JSON.stringify(options.jsonBody);\n headers.append('Content-Type', 'application/json');\n }\n if (clientId && type !== 'auth') {\n headers.append('Client-ID', clientId);\n }\n if (accessToken) {\n headers.append('Authorization', `${type === 'helix' ? authorizationType ?? 'Bearer' : 'OAuth'} ${accessToken}`);\n }\n const requestOptions = {\n ...fetchOptions,\n method: options.method ?? 'GET',\n headers,\n body,\n };\n return await fetch(`${url}${params}`, requestOptions);\n}\n/**\n * Makes a call to the Twitch API using given credentials.\n *\n * @param options The configuration of the call.\n * @param clientId The client ID of your application.\n * @param accessToken The access token to call the API with.\n *\n * You need to obtain one using one of the [Twitch OAuth flows](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/).\n * @param authorizationType The type of Authorization header to send.\n *\n * Defaults to \"Bearer\" for Helix and \"OAuth\" for everything else.\n * @param fetchOptions Additional options to be passed to the `fetch` function.\n */\nexport async function callTwitchApi(options, clientId, accessToken, authorizationType, fetchOptions = {}) {\n const response = await callTwitchApiRaw(options, clientId, accessToken, authorizationType, fetchOptions);\n await handleTwitchApiResponseError(response, options);\n return await transformTwitchApiResponse(response);\n}\n", "import { extractUserId } from '@twurple/common';\nexport function createBroadcasterQuery(user) {\n return {\n broadcaster_id: extractUserId(user),\n };\n}\n", "import { CustomError } from '@twurple/common';\n/**\n * Thrown whenever you try using invalid values in the client configuration.\n */\nexport class ConfigError extends CustomError {\n}\n", "import { ResponseBasedRateLimiter } from '@d-fischer/rate-limiter';\nimport { callTwitchApiRaw } from '@twurple/api-call';\n/** @internal */\nexport class HelixRateLimiter extends ResponseBasedRateLimiter {\n async doRequest({ options, clientId, accessToken, authorizationType, fetchOptions, }) {\n return await callTwitchApiRaw(options, clientId, accessToken, authorizationType, fetchOptions);\n }\n needsToRetryAfter(res) {\n if (res.status === 429 &&\n (!res.headers.has('ratelimit-remaining') || Number(res.headers.get('ratelimit-remaining')) === 0)) {\n return +res.headers.get('ratelimit-reset') * 1000 - Date.now();\n }\n return null;\n }\n getParametersFromResponse(res) {\n const { headers } = res;\n return {\n limit: +headers.get('ratelimit-limit'),\n remaining: +headers.get('ratelimit-remaining'),\n resetsAt: +headers.get('ratelimit-reset') * 1000,\n };\n }\n}\n", "function createSingleCacheKey(param) {\n // noinspection FallThroughInSwitchStatementJS\n switch (typeof param) {\n case 'undefined': {\n return '';\n }\n case 'object': {\n if (param === null) {\n return '';\n }\n if ('cacheKey' in param) {\n return param.cacheKey;\n }\n const objKey = JSON.stringify(param);\n if (objKey !== '{}') {\n return objKey;\n }\n }\n // fallthrough\n default: {\n return param.toString();\n }\n }\n}\nexport function createCacheKey(propName, params, prefix) {\n return [propName, ...params.map(createSingleCacheKey)].join('/') + (prefix ? '/' : '');\n}\n", "import { createCacheKey } from \"../utils/createCacheKey.mjs\";\nconst cacheSymbol = Symbol('cache');\nexport function Cacheable(cls) {\n var _a, _b;\n return _b = class extends cls {\n constructor() {\n super(...arguments);\n this[_a] = new Map();\n }\n getFromCache(cacheKey) {\n this._cleanCache();\n if (this[cacheSymbol].has(cacheKey)) {\n const entry = this[cacheSymbol].get(cacheKey);\n if (entry) {\n return entry.value;\n }\n }\n return undefined;\n }\n setCache(cacheKey, value, timeInSeconds) {\n this[cacheSymbol].set(cacheKey, {\n value,\n expires: Date.now() + timeInSeconds * 1000\n });\n }\n removeFromCache(cacheKey, prefix) {\n const internalCacheKey = this._getInternalCacheKey(cacheKey, prefix);\n if (prefix) {\n this[cacheSymbol].forEach((val, key) => {\n if (key.startsWith(internalCacheKey)) {\n this[cacheSymbol].delete(key);\n }\n });\n }\n else {\n this[cacheSymbol].delete(internalCacheKey);\n }\n }\n _cleanCache() {\n const now = Date.now();\n this[cacheSymbol].forEach((val, key) => {\n if (val.expires < now) {\n this[cacheSymbol].delete(key);\n }\n });\n }\n _getInternalCacheKey(cacheKey, prefix) {\n if (typeof cacheKey === 'string') {\n let internalCacheKey = cacheKey;\n if (!internalCacheKey.endsWith('/')) {\n internalCacheKey += '/';\n }\n return internalCacheKey;\n }\n else {\n const propName = cacheKey.shift();\n return createCacheKey(propName, cacheKey, prefix);\n }\n }\n },\n _a = cacheSymbol,\n _b;\n}\n", "import { createCacheKey } from \"../utils/createCacheKey.mjs\";\nexport function CachedGetter(timeInSeconds = Infinity) {\n return function (target, propName, descriptor) {\n if (descriptor.get) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const origFn = descriptor.get;\n descriptor.get = function () {\n const cacheKey = createCacheKey(propName, []);\n const cachedValue = this.getFromCache(cacheKey);\n if (cachedValue) {\n return cachedValue;\n }\n const result = origFn.call(this);\n this.setCache(cacheKey, result, timeInSeconds);\n return result;\n };\n }\n return descriptor;\n };\n}\n", "export class Listener {\n /** @private */\n constructor(owner, event, listener, \n /** @private */ _internal = false) {\n this.owner = owner;\n this.event = event;\n this.listener = listener;\n this._internal = _internal;\n }\n unbind() {\n this.owner.removeListener(this);\n }\n}\n", "import { Listener } from \"./Listener.mjs\";\nexport class EventEmitter {\n constructor() {\n this._eventListeners = new Map();\n this._internalEventListeners = new Map();\n }\n on(event, listener) {\n return this._addListener(false, event, listener);\n }\n addListener(event, listener) {\n return this._addListener(false, event, listener);\n }\n removeListener(idOrEvent, listener) {\n this._removeListener(false, idOrEvent, listener);\n }\n registerEvent() {\n const eventBinder = (handler) => this.addListener(eventBinder, handler);\n return eventBinder;\n }\n emit(event, ...args) {\n if (this._eventListeners.has(event)) {\n for (const listener of this._eventListeners.get(event)) {\n listener(...args);\n }\n }\n if (this._internalEventListeners.has(event)) {\n for (const listener of this._internalEventListeners.get(event)) {\n listener(...args);\n }\n }\n }\n registerInternalEvent() {\n const eventBinder = (handler) => this.addInternalListener(eventBinder, handler);\n return eventBinder;\n }\n addInternalListener(event, listener) {\n return this._addListener(true, event, listener);\n }\n removeInternalListener(idOrEvent, listener) {\n this._removeListener(true, idOrEvent, listener);\n }\n _addListener(internal, event, listener) {\n const listenerMap = internal ? this._eventListeners : this._internalEventListeners;\n if (listenerMap.has(event)) {\n listenerMap.get(event).push(listener);\n }\n else {\n listenerMap.set(event, [listener]);\n }\n return new Listener(this, event, listener, internal);\n }\n _removeListener(internal, idOrEvent, listener) {\n const listenerMap = internal ? this._eventListeners : this._internalEventListeners;\n if (!idOrEvent) {\n listenerMap.clear();\n }\n else if (typeof idOrEvent === 'object') {\n const id = idOrEvent;\n this._removeListener(id._internal, id.event, id.listener);\n }\n else {\n const event = idOrEvent;\n if (listenerMap.has(event)) {\n if (listener) {\n const listeners = listenerMap.get(event);\n let idx = 0;\n while ((idx = listeners.indexOf(listener)) !== -1) {\n listeners.splice(idx, 1);\n }\n }\n else {\n listenerMap.delete(event);\n }\n }\n }\n }\n}\n", "import { mapNullable } from '@d-fischer/shared-utils';\n// one minute\nconst EXPIRY_GRACE_PERIOD = 60000;\nfunction getExpiryMillis(token) {\n return mapNullable(token.expiresIn, _ => token.obtainmentTimestamp + _ * 1000 - EXPIRY_GRACE_PERIOD);\n}\n/**\n * Calculates the date when the access token will expire.\n *\n * A one-minute grace period is applied for smooth handling of API latency.\n *\n * May be `null`, in which case the token does not expire.\n * This can only be the case with very old Client IDs.\n *\n * @param token The access token.\n */\nexport function getExpiryDateOfAccessToken(token) {\n return mapNullable(getExpiryMillis(token), _ => new Date(_));\n}\n/**\n * Calculates whether the given access token is expired.\n *\n * A one-minute grace period is applied for smooth handling of API latency.\n *\n * @param token The access token.\n */\nexport function accessTokenIsExpired(token) {\n return mapNullable(getExpiryMillis(token), _ => Date.now() > _) ?? false;\n}\n", "import { CustomError } from '@twurple/common';\n/**\n * Thrown whenever an invalid token is supplied.\n */\nexport class InvalidTokenError extends CustomError {\n /** @private */\n constructor(options) {\n super('Invalid token supplied', options);\n }\n}\n", "/** @internal */\nexport function createExchangeCodeQuery(clientId, clientSecret, code, redirectUri) {\n return {\n grant_type: 'authorization_code',\n client_id: clientId,\n client_secret: clientSecret,\n code,\n redirect_uri: redirectUri,\n };\n}\n/** @internal */\nexport function createGetAppTokenQuery(clientId, clientSecret) {\n return {\n grant_type: 'client_credentials',\n client_id: clientId,\n client_secret: clientSecret,\n };\n}\n/** @internal */\nexport function createRefreshTokenQuery(clientId, clientSecret, refreshToken) {\n return {\n grant_type: 'refresh_token',\n client_id: clientId,\n client_secret: clientSecret,\n refresh_token: refreshToken,\n };\n}\n/** @internal */\nexport function createRevokeTokenQuery(clientId, accessToken) {\n return {\n client_id: clientId,\n token: accessToken,\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { mapNullable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Information about an access token.\n */\nlet TokenInfo = class TokenInfo extends DataObject {\n _obtainmentDate;\n /** @internal */\n constructor(data) {\n super(data);\n this._obtainmentDate = new Date();\n }\n /**\n * The client ID.\n */\n get clientId() {\n return this[rawDataSymbol].client_id;\n }\n /**\n * The ID of the authenticated user.\n */\n get userId() {\n return this[rawDataSymbol].user_id ?? null;\n }\n /**\n * The name of the authenticated user.\n */\n get userName() {\n return this[rawDataSymbol].login ?? null;\n }\n /**\n * The scopes for which the token is valid.\n */\n get scopes() {\n return this[rawDataSymbol].scopes;\n }\n /**\n * The time when the token will expire.\n *\n * If this returns null, it means that the token never expires (happens with some old client IDs).\n */\n get expiryDate() {\n return mapNullable(this[rawDataSymbol].expires_in, v => new Date(this._obtainmentDate.getTime() + v * 1000));\n }\n};\nTokenInfo = __decorate([\n rtfm('auth', 'TokenInfo', 'clientId')\n], TokenInfo);\nexport { TokenInfo };\n", "import { callTwitchApi, HttpStatusCodeError } from '@twurple/api-call';\nimport { InvalidTokenError } from './errors/InvalidTokenError.js';\nimport { InvalidTokenTypeError } from './errors/InvalidTokenTypeError.js';\nimport { createExchangeCodeQuery, createGetAppTokenQuery, createRefreshTokenQuery, createRevokeTokenQuery, } from './helpers.external.js';\nimport { TokenInfo } from './TokenInfo.js';\n/** @internal */\nfunction createAccessTokenFromData(data) {\n return {\n accessToken: data.access_token,\n refreshToken: data.refresh_token || null,\n scope: data.scope ?? [],\n expiresIn: data.expires_in ?? null,\n obtainmentTimestamp: Date.now(),\n };\n}\n/**\n * Gets an access token with your client credentials and an authorization code.\n *\n * @param clientId The client ID of your application.\n * @param clientSecret The client secret of your application.\n * @param code The authorization code.\n * @param redirectUri The redirect URI.\n *\n * This serves no real purpose here, but must still match one of the redirect URIs you configured in the Twitch Developer dashboard.\n */\nexport async function exchangeCode(clientId, clientSecret, code, redirectUri) {\n return createAccessTokenFromData(await callTwitchApi({\n type: 'auth',\n url: 'token',\n method: 'POST',\n query: createExchangeCodeQuery(clientId, clientSecret, code, redirectUri),\n }));\n}\n/**\n * Gets an app access token with your client credentials.\n *\n * @param clientId The client ID of your application.\n * @param clientSecret The client secret of your application.\n */\nexport async function getAppToken(clientId, clientSecret) {\n return createAccessTokenFromData(await callTwitchApi({\n type: 'auth',\n url: 'token',\n method: 'POST',\n query: createGetAppTokenQuery(clientId, clientSecret),\n }));\n}\n/**\n * Refreshes an expired access token with your client credentials and the refresh token that was given by the initial authentication.\n *\n * @param clientId The client ID of your application.\n * @param clientSecret The client secret of your application.\n * @param refreshToken The refresh token.\n */\nexport async function refreshUserToken(clientId, clientSecret, refreshToken) {\n return createAccessTokenFromData(await callTwitchApi({\n type: 'auth',\n url: 'token',\n method: 'POST',\n query: createRefreshTokenQuery(clientId, clientSecret, refreshToken),\n }));\n}\n/**\n * Revokes an access token.\n *\n * @param clientId The client ID of your application.\n * @param accessToken The access token.\n */\nexport async function revokeToken(clientId, accessToken) {\n await callTwitchApi({\n type: 'auth',\n url: 'revoke',\n method: 'POST',\n query: createRevokeTokenQuery(clientId, accessToken),\n });\n}\n/**\n * Gets information about an access token.\n *\n * @param accessToken The access token to get the information of.\n * @param clientId The client ID of your application.\n *\n * You need to obtain one using one of the [Twitch OAuth flows](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/).\n */\nexport async function getTokenInfo(accessToken, clientId) {\n try {\n const data = await callTwitchApi({ type: 'auth', url: 'validate' }, clientId, accessToken);\n return new TokenInfo(data);\n }\n catch (e) {\n if (e instanceof HttpStatusCodeError && e.statusCode === 401) {\n throw new InvalidTokenError({ cause: e });\n }\n throw e;\n }\n}\n/** @private */\nexport async function getValidTokenFromProviderForUser(provider, userId, scopes, logger) {\n let lastTokenError = null;\n let foundUser = false;\n try {\n const accessToken = await provider.getAccessTokenForUser(userId, scopes);\n if (accessToken) {\n foundUser = true;\n // check validity\n const tokenInfo = await getTokenInfo(accessToken.accessToken);\n return { accessToken, tokenInfo };\n }\n }\n catch (e) {\n if (e instanceof InvalidTokenError) {\n lastTokenError = e;\n }\n else {\n logger?.error(`Retrieving an access token failed: ${e.message}`);\n }\n }\n if (foundUser) {\n logger?.warn('No valid token available; trying to refresh');\n if (provider.refreshAccessTokenForUser) {\n try {\n const newToken = await provider.refreshAccessTokenForUser(userId);\n // check validity\n const tokenInfo = await getTokenInfo(newToken.accessToken);\n return { accessToken: newToken, tokenInfo };\n }\n catch (e) {\n if (e instanceof InvalidTokenError) {\n lastTokenError = e;\n }\n else {\n logger?.error(`Refreshing the access token failed: ${e.message}`);\n }\n }\n }\n }\n throw lastTokenError ?? new Error('Could not retrieve a valid token');\n}\n/** @private */\nexport async function getValidTokenFromProviderForIntent(provider, intent, scopes, logger) {\n let lastTokenError = null;\n let foundUser = false;\n if (!provider.getAccessTokenForIntent) {\n throw new InvalidTokenTypeError(`This call requires an AuthProvider that supports intents.\nPlease use an auth provider that does, such as \\`RefreshingAuthProvider\\`.`);\n }\n try {\n const accessToken = await provider.getAccessTokenForIntent(intent, scopes);\n if (accessToken) {\n foundUser = true;\n // check validity\n const tokenInfo = await getTokenInfo(accessToken.accessToken);\n return { accessToken, tokenInfo };\n }\n }\n catch (e) {\n if (e instanceof InvalidTokenError) {\n lastTokenError = e;\n }\n else {\n logger?.error(`Retrieving an access token failed: ${e.message}`);\n }\n }\n if (foundUser) {\n logger?.warn('No valid token available; trying to refresh');\n if (provider.refreshAccessTokenForIntent) {\n try {\n const newToken = await provider.refreshAccessTokenForIntent(intent);\n // check validity\n const tokenInfo = await getTokenInfo(newToken.accessToken);\n return { accessToken: newToken, tokenInfo };\n }\n catch (e) {\n if (e instanceof InvalidTokenError) {\n lastTokenError = e;\n }\n else {\n logger?.error(`Refreshing the access token failed: ${e.message}`);\n }\n }\n }\n }\n throw lastTokenError ?? new Error('Could not retrieve a valid token');\n}\nconst scopeEquivalencies = new Map([\n ['channel_commercial', ['channel:edit:commercial']],\n ['channel_editor', ['channel:manage:broadcast']],\n ['channel_read', ['channel:read:stream_key']],\n ['channel_subscriptions', ['channel:read:subscriptions']],\n ['user_blocks_read', ['user:read:blocked_users']],\n ['user_blocks_edit', ['user:manage:blocked_users']],\n ['user_follows_edit', ['user:edit:follows']],\n ['user_read', ['user:read:email']],\n ['user_subscriptions', ['user:read:subscriptions']],\n ['user:edit:broadcast', ['channel:manage:broadcast', 'channel:manage:extensions']],\n]);\n/**\n * Compares scopes for a non-upgradable {@link AuthProvider} instance.\n *\n * @param scopesToCompare The scopes to compare against.\n * @param requestedScopes The scopes you requested.\n */\nexport function compareScopes(scopesToCompare, requestedScopes) {\n if (requestedScopes?.length) {\n const scopes = new Set(scopesToCompare.flatMap(scope => [scope, ...(scopeEquivalencies.get(scope) ?? [])]));\n if (requestedScopes.every(scope => !scopes.has(scope))) {\n const scopesStr = requestedScopes.join(', ');\n throw new Error(`This token does not have any of the requested scopes (${scopesStr}) and can not be upgraded.\nIf you need dynamically upgrading scopes, please implement the AuthProvider interface accordingly:\n\n\\thttps://twurple.js.org/reference/auth/interfaces/AuthProvider.html`);\n }\n }\n}\n/**\n * Compares scope sets for a non-upgradable {@link AuthProvider} instance.\n *\n * @param scopesToCompare The scopes to compare against.\n * @param requestedScopeSets The scope sets you requested.\n */\nexport function compareScopeSets(scopesToCompare, requestedScopeSets) {\n for (const requestedScopes of requestedScopeSets) {\n compareScopes(scopesToCompare, requestedScopes);\n }\n}\n/**\n * Compares scopes for a non-upgradable `AuthProvider` instance, loading them from the token if necessary,\n * and returns them together with the user ID.\n *\n * @param clientId The client ID of your application.\n * @param token The access token.\n * @param userId The user ID that was already loaded.\n * @param loadedScopes The scopes that were already loaded.\n * @param requestedScopeSets The scope sets you requested.\n */\nexport async function loadAndCompareTokenInfo(clientId, token, userId, loadedScopes, requestedScopeSets) {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n if (requestedScopeSets?.length || !userId) {\n const userInfo = await getTokenInfo(token, clientId);\n if (!userInfo.userId) {\n throw new Error('Trying to use an app access token as a user access token');\n }\n const scopesToCompare = loadedScopes ?? userInfo.scopes;\n if (requestedScopeSets) {\n compareScopeSets(scopesToCompare, requestedScopeSets.filter((val) => Boolean(val)));\n }\n return [scopesToCompare, userInfo.userId];\n }\n return [loadedScopes, userId];\n}\n", "import { promiseWithResolvers } from '@d-fischer/shared-utils';\nexport class TokenFetcher {\n _executor;\n _newTokenScopeSets = [];\n _newTokenPromise = null;\n _queuedScopeSets = [];\n _queueExecutor = null;\n _queuePromise = null;\n constructor(executor) {\n this._executor = executor;\n }\n async fetch(...scopeSets) {\n const filteredScopeSets = scopeSets.filter((val) => Boolean(val));\n if (this._newTokenPromise) {\n if (!filteredScopeSets.length) {\n return await this._newTokenPromise;\n }\n if (this._queueExecutor) {\n this._queuedScopeSets.push(...filteredScopeSets);\n }\n else {\n this._queuedScopeSets = [...filteredScopeSets];\n }\n if (!this._queuePromise) {\n const { promise, resolve, reject } = promiseWithResolvers();\n this._queuePromise = promise;\n this._queueExecutor = async () => {\n if (!this._queuePromise) {\n return;\n }\n this._newTokenScopeSets = this._queuedScopeSets;\n this._queuedScopeSets = [];\n this._newTokenPromise = this._queuePromise;\n this._queuePromise = null;\n this._queueExecutor = null;\n try {\n resolve(await this._executor(this._newTokenScopeSets));\n }\n catch (e) {\n reject(e);\n }\n finally {\n this._newTokenPromise = null;\n this._newTokenScopeSets = [];\n this._queueExecutor?.();\n }\n };\n }\n return await this._queuePromise;\n }\n this._newTokenScopeSets = [...filteredScopeSets];\n const { promise, resolve, reject } = promiseWithResolvers();\n this._newTokenPromise = promise;\n try {\n resolve(await this._executor(this._newTokenScopeSets));\n }\n catch (e) {\n reject(e);\n }\n finally {\n this._newTokenPromise = null;\n this._newTokenScopeSets = [];\n this._queueExecutor?.();\n }\n return await promise;\n }\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { accessTokenIsExpired } from '../AccessToken.js';\nimport { getAppToken } from '../helpers.js';\nimport { TokenFetcher } from '../TokenFetcher.js';\n/**\n * An auth provider that gets tokens using client credentials.\n */\nlet AppTokenAuthProvider = class AppTokenAuthProvider {\n _clientId;\n /** @internal */ _clientSecret;\n /** @internal */ _token;\n /** @internal */ _fetcher;\n _impliedScopes;\n /**\n * Creates a new auth provider to receive an application token with using the client ID and secret.\n *\n * @param clientId The client ID of your application.\n * @param clientSecret The client secret of your application.\n * @param impliedScopes The scopes that are implied for your application,\n * for example an extension that is allowed to access subscriptions.\n */\n constructor(clientId, clientSecret, impliedScopes = []) {\n this._clientId = clientId;\n this._clientSecret = clientSecret;\n this._impliedScopes = impliedScopes;\n this._fetcher = new TokenFetcher(async (scopes) => await this._fetch(scopes));\n }\n /**\n * The client ID.\n */\n get clientId() {\n return this._clientId;\n }\n /**\n * The scopes that are currently available using the access token.\n */\n get currentScopes() {\n return this._impliedScopes;\n }\n /**\n * Can only get tokens for implied scopes (i.e. extension subscription support).\n *\n * The consumer is expected to take care that this is actually set up in the Twitch developer console.\n *\n * @param user The user to get an access token for.\n * @param scopeSets The requested scopes.\n */\n async getAccessTokenForUser(user, ...scopeSets) {\n if (scopeSets.every(scopeSet => scopeSet?.some(scope => this._impliedScopes.includes(scope)) ?? true)) {\n const appToken = await this.getAppAccessToken();\n return {\n ...appToken,\n userId: extractUserId(user),\n };\n }\n throw new Error('Can not get user access token for AppTokenAuthProvider');\n }\n /**\n * Throws, because this auth provider does not support user authentication.\n */\n getCurrentScopesForUser() {\n return this._impliedScopes;\n }\n /**\n * Fetches an app access token.\n */\n async getAnyAccessToken() {\n return await this._fetcher.fetch();\n }\n /**\n * Fetches an app access token.\n *\n * @param forceNew Whether to always get a new token, even if the old one is still deemed valid internally.\n */\n async getAppAccessToken(forceNew = false) {\n if (forceNew) {\n this._token = undefined;\n }\n return await this._fetcher.fetch();\n }\n async _fetch(scopeSets) {\n if (scopeSets.length > 0) {\n for (const scopes of scopeSets) {\n if (this._impliedScopes.length) {\n if (scopes.every(scope => !this._impliedScopes.includes(scope))) {\n throw new Error(`One of the scopes ${scopes.join(', ')} requested but only the scope ${this._impliedScopes.join(', ')} is implied`);\n }\n }\n else {\n throw new Error(`One of the scopes ${scopes.join(', ')} requested but the client credentials flow does not support scopes`);\n }\n }\n }\n if (!this._token || accessTokenIsExpired(this._token)) {\n return (this._token = await getAppToken(this._clientId, this._clientSecret));\n }\n return this._token;\n }\n};\n__decorate([\n Enumerable(false)\n], AppTokenAuthProvider.prototype, \"_clientSecret\", void 0);\n__decorate([\n Enumerable(false)\n], AppTokenAuthProvider.prototype, \"_token\", void 0);\n__decorate([\n Enumerable(false)\n], AppTokenAuthProvider.prototype, \"_fetcher\", void 0);\nAppTokenAuthProvider = __decorate([\n rtfm('auth', 'AppTokenAuthProvider', 'clientId')\n], AppTokenAuthProvider);\nexport { AppTokenAuthProvider };\n", "import { __decorate } from \"tslib\";\nimport { Cacheable, CachedGetter } from '@d-fischer/cache-decorators';\nimport { ResponseBasedRateLimiter } from '@d-fischer/rate-limiter';\nimport { promiseWithResolvers } from '@d-fischer/shared-utils';\nimport { EventEmitter } from '@d-fischer/typed-event-emitter';\nimport { callTwitchApi, callTwitchApiRaw, handleTwitchApiResponseError, HttpStatusCodeError, transformTwitchApiResponse, } from '@twurple/api-call';\nimport { accessTokenIsExpired, InvalidTokenError, TokenInfo, } from '@twurple/auth';\nimport { HellFreezesOverError, rtfm } from '@twurple/common';\nimport * as retry from 'retry';\nimport { HelixBitsApi } from '../endpoints/bits/HelixBitsApi.js';\nimport { HelixChannelApi } from '../endpoints/channel/HelixChannelApi.js';\nimport { HelixChannelPointsApi } from '../endpoints/channelPoints/HelixChannelPointsApi.js';\nimport { HelixCharityApi } from '../endpoints/charity/HelixCharityApi.js';\nimport { HelixChatApi } from '../endpoints/chat/HelixChatApi.js';\nimport { HelixClipApi } from '../endpoints/clip/HelixClipApi.js';\nimport { HelixContentClassificationLabelApi } from '../endpoints/contentClassificationLabels/HelixContentClassificationLabelApi.js';\nimport { HelixEntitlementApi } from '../endpoints/entitlements/HelixEntitlementApi.js';\nimport { HelixEventSubApi } from '../endpoints/eventSub/HelixEventSubApi.js';\nimport { HelixExtensionsApi } from '../endpoints/extensions/HelixExtensionsApi.js';\nimport { HelixGameApi } from '../endpoints/game/HelixGameApi.js';\nimport { HelixGoalApi } from '../endpoints/goals/HelixGoalApi.js';\nimport { HelixHypeTrainApi } from '../endpoints/hypeTrain/HelixHypeTrainApi.js';\nimport { HelixModerationApi } from '../endpoints/moderation/HelixModerationApi.js';\nimport { HelixPollApi } from '../endpoints/poll/HelixPollApi.js';\nimport { HelixPredictionApi } from '../endpoints/prediction/HelixPredictionApi.js';\nimport { HelixRaidApi } from '../endpoints/raids/HelixRaidApi.js';\nimport { HelixScheduleApi } from '../endpoints/schedule/HelixScheduleApi.js';\nimport { HelixSearchApi } from '../endpoints/search/HelixSearchApi.js';\nimport { HelixStreamApi } from '../endpoints/stream/HelixStreamApi.js';\nimport { HelixSubscriptionApi } from '../endpoints/subscriptions/HelixSubscriptionApi.js';\nimport { HelixTeamApi } from '../endpoints/team/HelixTeamApi.js';\nimport { HelixUserApi } from '../endpoints/user/HelixUserApi.js';\nimport { HelixVideoApi } from '../endpoints/video/HelixVideoApi.js';\nimport { HelixWhisperApi } from '../endpoints/whisper/HelixWhisperApi.js';\nimport { ApiReportedRequest } from '../reporting/ApiReportedRequest.js';\n/** @private */\nlet BaseApiClient = class BaseApiClient extends EventEmitter {\n _config;\n _logger;\n _rateLimiter;\n onRequest = this.registerEvent();\n /** @internal */\n constructor(config, logger, rateLimiter) {\n super();\n this._config = config;\n this._logger = logger;\n this._rateLimiter = rateLimiter;\n }\n /**\n * Requests scopes from the auth provider for the given user.\n *\n * @param user The user to request scopes for.\n * @param scopes The scopes to request.\n */\n async requestScopesForUser(user, scopes) {\n await this._config.authProvider.getAccessTokenForUser(user, ...scopes.map(scope => [scope]));\n }\n /**\n * Gets information about your access token.\n */\n async getTokenInfo() {\n try {\n const data = await this.callApi({ type: 'auth', url: 'validate' });\n return new TokenInfo(data);\n }\n catch (e) {\n if (e instanceof HttpStatusCodeError && e.statusCode === 401) {\n throw new InvalidTokenError({ cause: e });\n }\n throw e;\n }\n }\n /**\n * Makes a call to the Twitch API using your access token.\n *\n * @param options The configuration of the call.\n */\n async callApi(options) {\n const { authProvider } = this._config;\n const shouldAuth = options.auth ?? true;\n if (!shouldAuth) {\n return await callTwitchApi(options, authProvider.clientId, undefined, undefined, this._config.fetchOptions);\n }\n let forceUser = false;\n if (options.forceType) {\n switch (options.forceType) {\n case 'app': {\n if (!authProvider.getAppAccessToken) {\n throw new Error('Tried to make an API call that requires an app access token but your auth provider does not support that');\n }\n const accessToken = await authProvider.getAppAccessToken();\n return await this._callApiUsingInitialToken(options, accessToken);\n }\n case 'user': {\n forceUser = true;\n break;\n }\n default: {\n throw new HellFreezesOverError(`Unknown forced token type: ${options.forceType}`);\n }\n }\n }\n if (options.scopes) {\n forceUser = true;\n }\n if (forceUser) {\n const contextUserId = options.canOverrideScopedUserContext\n ? this._getUserIdFromRequestContext(options.userId)\n : options.userId;\n if (!contextUserId) {\n throw new Error('Tried to make an API call with a user context but no context user ID');\n }\n const accessToken = await authProvider.getAccessTokenForUser(contextUserId, options.scopes);\n if (!accessToken) {\n throw new Error(`Tried to make an API call with a user context for user ID ${contextUserId} but no token was found`);\n }\n if (accessTokenIsExpired(accessToken) && authProvider.refreshAccessTokenForUser) {\n const newAccessToken = await authProvider.refreshAccessTokenForUser(contextUserId);\n return await this._callApiUsingInitialToken(options, newAccessToken, true);\n }\n return await this._callApiUsingInitialToken(options, accessToken);\n }\n const requestContextUserId = this._getUserIdFromRequestContext(options.userId);\n const accessToken = requestContextUserId === null\n ? await authProvider.getAnyAccessToken()\n : await authProvider.getAnyAccessToken(requestContextUserId ?? options.userId);\n if (accessTokenIsExpired(accessToken) && accessToken.userId && authProvider.refreshAccessTokenForUser) {\n const newAccessToken = await authProvider.refreshAccessTokenForUser(accessToken.userId);\n return await this._callApiUsingInitialToken(options, newAccessToken, true);\n }\n return await this._callApiUsingInitialToken(options, accessToken);\n }\n /**\n * The Helix bits API methods.\n */\n get bits() {\n return new HelixBitsApi(this);\n }\n /**\n * The Helix channels API methods.\n */\n get channels() {\n return new HelixChannelApi(this);\n }\n /**\n * The Helix channel points API methods.\n */\n get channelPoints() {\n return new HelixChannelPointsApi(this);\n }\n /**\n * The Helix charity API methods.\n */\n get charity() {\n return new HelixCharityApi(this);\n }\n /**\n * The Helix chat API methods.\n */\n get chat() {\n return new HelixChatApi(this);\n }\n /**\n * The Helix clips API methods.\n */\n get clips() {\n return new HelixClipApi(this);\n }\n /**\n * The Helix content classification label API methods.\n */\n get contentClassificationLabels() {\n return new HelixContentClassificationLabelApi(this);\n }\n /**\n * The Helix entitlement API methods.\n */\n get entitlements() {\n return new HelixEntitlementApi(this);\n }\n /**\n * The Helix EventSub API methods.\n */\n get eventSub() {\n return new HelixEventSubApi(this);\n }\n /**\n * The Helix extensions API methods.\n */\n get extensions() {\n return new HelixExtensionsApi(this);\n }\n /**\n * The Helix game API methods.\n */\n get games() {\n return new HelixGameApi(this);\n }\n /**\n * The Helix Hype Train API methods.\n */\n get hypeTrain() {\n return new HelixHypeTrainApi(this);\n }\n /**\n * The Helix goal API methods.\n */\n get goals() {\n return new HelixGoalApi(this);\n }\n /**\n * The Helix moderation API methods.\n */\n get moderation() {\n return new HelixModerationApi(this);\n }\n /**\n * The Helix poll API methods.\n */\n get polls() {\n return new HelixPollApi(this);\n }\n /**\n * The Helix prediction API methods.\n */\n get predictions() {\n return new HelixPredictionApi(this);\n }\n /**\n * The Helix raid API methods.\n */\n get raids() {\n return new HelixRaidApi(this);\n }\n /**\n * The Helix schedule API methods.\n */\n get schedule() {\n return new HelixScheduleApi(this);\n }\n /**\n * The Helix search API methods.\n */\n get search() {\n return new HelixSearchApi(this);\n }\n /**\n * The Helix stream API methods.\n */\n get streams() {\n return new HelixStreamApi(this);\n }\n /**\n * The Helix subscription API methods.\n */\n get subscriptions() {\n return new HelixSubscriptionApi(this);\n }\n /**\n * The Helix team API methods.\n */\n get teams() {\n return new HelixTeamApi(this);\n }\n /**\n * The Helix user API methods.\n */\n get users() {\n return new HelixUserApi(this);\n }\n /**\n * The Helix video API methods.\n */\n get videos() {\n return new HelixVideoApi(this);\n }\n /**\n * The API methods that deal with whispers.\n */\n get whispers() {\n return new HelixWhisperApi(this);\n }\n /**\n * Statistics on the rate limiter for the Helix API.\n */\n get rateLimiterStats() {\n if (this._rateLimiter instanceof ResponseBasedRateLimiter) {\n return this._rateLimiter.stats;\n }\n return null;\n }\n /** @private */\n get _authProvider() {\n return this._config.authProvider;\n }\n /** @internal */\n get _batchDelay() {\n return this._config.batchDelay ?? 0;\n }\n // null means app access, undefined means none specified\n /** @internal */\n _getUserIdFromRequestContext(contextUserId) {\n return contextUserId;\n }\n async _callApiUsingInitialToken(options, accessToken, wasRefreshed = false) {\n const { authProvider } = this._config;\n const { authorizationType } = authProvider;\n let response = await this._callApiInternal(options, authProvider.clientId, accessToken.accessToken, authorizationType);\n if (response.status === 401 && !wasRefreshed) {\n if (accessToken.userId) {\n if (authProvider.refreshAccessTokenForUser) {\n const token = await authProvider.refreshAccessTokenForUser(accessToken.userId);\n response = await this._callApiInternal(options, authProvider.clientId, token.accessToken, authorizationType);\n }\n }\n else if (authProvider.getAppAccessToken) {\n const token = await authProvider.getAppAccessToken(true);\n response = await this._callApiInternal(options, authProvider.clientId, token.accessToken, authorizationType);\n }\n }\n this.emit(this.onRequest, new ApiReportedRequest(options, response.status, accessToken.userId ?? null));\n await handleTwitchApiResponseError(response, options);\n return await transformTwitchApiResponse(response);\n }\n async _callApiInternal(options, clientId, accessToken, authorizationType) {\n const { fetchOptions } = this._config;\n const type = options.type ?? 'helix';\n this._logger.debug(`Calling ${type} API: ${options.method ?? 'GET'} ${options.url}`);\n this._logger.trace(`Query: ${JSON.stringify(options.query)}`);\n if (options.jsonBody) {\n this._logger.trace(`Request body: ${JSON.stringify(options.jsonBody)}`);\n }\n const op = retry.operation({\n retries: 3,\n minTimeout: 500,\n factor: 2,\n });\n const { promise, resolve, reject } = promiseWithResolvers();\n op.attempt(async () => {\n try {\n const response = type === 'helix'\n ? await this._rateLimiter.request({\n options,\n clientId,\n accessToken,\n authorizationType,\n fetchOptions,\n })\n : await callTwitchApiRaw(options, clientId, accessToken, authorizationType, fetchOptions);\n if (!response.ok && response.status >= 500 && response.status < 600) {\n await handleTwitchApiResponseError(response, options);\n }\n resolve(response);\n }\n catch (e) {\n if (op.retry(e)) {\n return;\n }\n reject(op.mainError());\n }\n });\n const result = await promise;\n this._logger.debug(`Called ${type} API: ${options.method ?? 'GET'} ${options.url} - result: ${result.status}`);\n return result;\n }\n};\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"bits\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"channels\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"channelPoints\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"charity\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"chat\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"clips\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"contentClassificationLabels\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"entitlements\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"eventSub\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"extensions\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"games\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"hypeTrain\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"goals\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"moderation\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"polls\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"predictions\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"raids\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"schedule\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"search\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"streams\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"subscriptions\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"teams\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"users\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"videos\", null);\n__decorate([\n CachedGetter()\n], BaseApiClient.prototype, \"whispers\", null);\nBaseApiClient = __decorate([\n Cacheable,\n rtfm('api', 'ApiClient')\n], BaseApiClient);\nexport { BaseApiClient };\n", "/** @internal */\nexport function createBitsLeaderboardQuery(params = {}) {\n const { count = 10, period = 'all', startDate, contextUserId } = params;\n return {\n count: count.toString(),\n period,\n started_at: startDate?.toISOString(),\n user_id: contextUserId,\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\n/** @private */\nexport class BaseApi {\n /** @internal */ _client;\n /** @internal */\n constructor(client) {\n this._client = client;\n }\n /** @internal */\n _getUserContextIdWithDefault(userId) {\n return this._client._getUserIdFromRequestContext(userId) ?? userId;\n }\n}\n__decorate([\n Enumerable(false)\n], BaseApi.prototype, \"_client\", void 0);\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A Bits leaderboard entry.\n */\nlet HelixBitsLeaderboardEntry = class HelixBitsLeaderboardEntry extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the user on the leaderboard.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user on the leaderboard.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user on the leaderboard.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * The position of the user on the leaderboard.\n */\n get rank() {\n return this[rawDataSymbol].rank;\n }\n /**\n * The amount of bits used in the given period of time.\n */\n get amount() {\n return this[rawDataSymbol].score;\n }\n /**\n * Gets the user of entry on the leaderboard.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixBitsLeaderboardEntry.prototype, \"_client\", void 0);\nHelixBitsLeaderboardEntry = __decorate([\n rtfm('api', 'HelixBitsLeaderboardEntry', 'userId')\n], HelixBitsLeaderboardEntry);\nexport { HelixBitsLeaderboardEntry };\n", "import { __decorate } from \"tslib\";\nimport { Cacheable, CachedGetter } from '@d-fischer/cache-decorators';\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixBitsLeaderboardEntry } from './HelixBitsLeaderboardEntry.js';\n/**\n * A leaderboard where the users who used the most bits to a broadcaster are listed.\n */\nlet HelixBitsLeaderboard = class HelixBitsLeaderboard extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The entries of the leaderboard.\n */\n get entries() {\n return this[rawDataSymbol].data.map(entry => new HelixBitsLeaderboardEntry(entry, this._client));\n }\n /**\n * The total amount of people on the requested leaderboard.\n */\n get totalCount() {\n return this[rawDataSymbol].total;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixBitsLeaderboard.prototype, \"_client\", void 0);\n__decorate([\n CachedGetter()\n], HelixBitsLeaderboard.prototype, \"entries\", null);\nHelixBitsLeaderboard = __decorate([\n Cacheable,\n rtfm('api', 'HelixBitsLeaderboard')\n], HelixBitsLeaderboard);\nexport { HelixBitsLeaderboard };\n", "import { __decorate } from \"tslib\";\nimport { indexBy } from '@d-fischer/shared-utils';\nimport { DataObject, HellFreezesOverError, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A list of cheermotes you can use globally or in a specific channel, depending on how you fetched the list.\n *\n * @inheritDoc\n */\nlet HelixCheermoteList = class HelixCheermoteList extends DataObject {\n /** @internal */\n constructor(data) {\n super(indexBy(data, action => action.prefix.toLowerCase()));\n }\n /**\n * Gets the URL and color needed to properly represent a cheer of the given amount of bits with the given prefix.\n *\n * @param name The name/prefix of the cheermote.\n * @param bits The amount of bits cheered.\n * @param format The format of the cheermote you want to request.\n */\n getCheermoteDisplayInfo(name, bits, format) {\n name = name.toLowerCase();\n const { background, state, scale } = format;\n const { tiers } = this[rawDataSymbol][name];\n const correctTier = tiers.sort((a, b) => b.min_bits - a.min_bits).find(tier => tier.min_bits <= bits);\n if (!correctTier) {\n throw new HellFreezesOverError(`Cheermote \"${name}\" does not have an applicable tier for ${bits} bits`);\n }\n return {\n url: correctTier.images[background][state][scale],\n color: correctTier.color,\n };\n }\n /**\n * Gets all possible cheermote names.\n */\n getPossibleNames() {\n return Object.keys(this[rawDataSymbol]);\n }\n};\nHelixCheermoteList = __decorate([\n rtfm('api', 'HelixCheermoteList')\n], HelixCheermoteList);\nexport { HelixCheermoteList };\n", "import { __decorate } from \"tslib\";\nimport { mapOptional } from '@d-fischer/shared-utils';\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createBitsLeaderboardQuery, } from '../../interfaces/endpoints/bits.external.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixBitsLeaderboard } from './HelixBitsLeaderboard.js';\nimport { HelixCheermoteList } from './HelixCheermoteList.js';\n/**\n * The Helix API methods that deal with bits.\n *\n * Can be accessed using `client.bits` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const leaderboard = await api.bits.getLeaderboard({ period: 'day' });\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Bits\n */\nlet HelixBitsApi = class HelixBitsApi extends BaseApi {\n /**\n * Gets a bits leaderboard of your channel.\n *\n * @param broadcaster The user to get the leaderboard of.\n * @param params\n * @expandParams\n */\n async getLeaderboard(broadcaster, params = {}) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'bits/leaderboard',\n userId: extractUserId(broadcaster),\n scopes: ['bits:read'],\n query: createBitsLeaderboardQuery(params),\n });\n return new HelixBitsLeaderboard(result, this._client);\n }\n /**\n * Gets all available cheermotes.\n *\n * @param broadcaster The broadcaster to include custom cheermotes of.\n *\n * If not given, only get global cheermotes.\n */\n async getCheermotes(broadcaster) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'bits/cheermotes',\n userId: mapOptional(broadcaster, extractUserId),\n query: mapOptional(broadcaster, createBroadcasterQuery),\n });\n return new HelixCheermoteList(result.data);\n }\n};\nHelixBitsApi = __decorate([\n rtfm('api', 'HelixBitsApi')\n], HelixBitsApi);\nexport { HelixBitsApi };\n", "import { mapOptional } from '@d-fischer/shared-utils';\nimport { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createChannelUpdateBody(data) {\n return {\n game_id: data.gameId,\n broadcaster_language: data.language,\n title: data.title,\n delay: data.delay?.toString(),\n tags: data.tags,\n content_classification_labels: data.contentClassificationLabels,\n is_branded_content: data.isBrandedContent,\n };\n}\n/** @internal */\nexport function createChannelCommercialBody(broadcaster, length) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n length,\n };\n}\n/** @internal */\nexport function createChannelVipUpdateQuery(broadcaster, user) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n user_id: extractUserId(user),\n };\n}\n/** @internal */\nexport function createChannelFollowerQuery(broadcaster, user) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n user_id: mapOptional(user, extractUserId),\n };\n}\n/** @internal */\nexport function createFollowedChannelQuery(user, broadcaster) {\n return {\n broadcaster_id: mapOptional(broadcaster, extractUserId),\n user_id: extractUserId(user),\n };\n}\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createSingleKeyQuery(key, value) {\n return { [key]: value };\n}\n/** @internal */\nexport function createUserQuery(user) {\n return {\n user_id: extractUserId(user),\n };\n}\n/** @internal */\nexport function createModeratorActionQuery(broadcaster, moderatorId) {\n return {\n broadcaster_id: broadcaster,\n moderator_id: moderatorId,\n };\n}\n/** @internal */\nexport function createGetByIdsQuery(broadcaster, rewardIds) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n id: rewardIds,\n };\n}\n/** @internal */\nexport function createChannelUsersCheckQuery(broadcaster, users) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n user_id: users.map(extractUserId),\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A relation of anything with a user.\n */\nlet HelixUserRelation = class HelixUserRelation extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the user.\n */\n get id() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user.\n */\n get name() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user.\n */\n get displayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets additional information about the user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixUserRelation.prototype, \"_client\", void 0);\nHelixUserRelation = __decorate([\n rtfm('api', 'HelixUserRelation', 'id')\n], HelixUserRelation);\nexport { HelixUserRelation };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable, indexBy, promiseWithResolvers } from '@d-fischer/shared-utils';\n/** @internal */\nexport class HelixRequestBatcher {\n _callOptions;\n _queryParamName;\n _matchKey;\n _mapper;\n _limitPerRequest;\n _client;\n _requestedIds = [];\n _requestResolversById = new Map();\n _delay;\n _waitTimer = null;\n constructor(_callOptions, _queryParamName, _matchKey, client, _mapper, _limitPerRequest = 100) {\n this._callOptions = _callOptions;\n this._queryParamName = _queryParamName;\n this._matchKey = _matchKey;\n this._mapper = _mapper;\n this._limitPerRequest = _limitPerRequest;\n this._client = client;\n this._delay = client._batchDelay;\n }\n async request(id) {\n const { promise, resolve, reject } = promiseWithResolvers();\n if (!this._requestedIds.includes(id)) {\n this._requestedIds.push(id);\n }\n if (this._requestResolversById.has(id)) {\n this._requestResolversById.get(id).push({ resolve, reject });\n }\n else {\n this._requestResolversById.set(id, [{ resolve, reject }]);\n }\n if (this._waitTimer) {\n clearTimeout(this._waitTimer);\n this._waitTimer = null;\n }\n if (this._requestedIds.length >= this._limitPerRequest) {\n void this._handleBatch(this._requestedIds.splice(0, this._limitPerRequest));\n }\n else {\n this._waitTimer = setTimeout(() => {\n void this._handleBatch(this._requestedIds.splice(0, this._limitPerRequest));\n }, this._delay);\n }\n return await promise;\n }\n async _handleBatch(ids) {\n try {\n const { data } = await this._doRequest(ids);\n const dataById = indexBy(data, this._matchKey);\n for (const id of ids) {\n for (const resolver of this._requestResolversById.get(id) ?? []) {\n if (Object.prototype.hasOwnProperty.call(dataById, id)) {\n resolver.resolve(this._mapper(dataById[id]));\n }\n else {\n resolver.resolve(null);\n }\n }\n this._requestResolversById.delete(id);\n }\n }\n catch (e) {\n await Promise.all(ids.map(async (id) => {\n try {\n const result = await this._doRequest([id]);\n for (const resolver of this._requestResolversById.get(id) ?? []) {\n resolver.resolve(result.data.length ? this._mapper(result.data[0]) : null);\n }\n }\n catch (e_) {\n for (const resolver of this._requestResolversById.get(id) ?? []) {\n resolver.reject(e_);\n }\n }\n this._requestResolversById.delete(id);\n }));\n }\n }\n async _doRequest(ids) {\n return await this._client.callApi({\n type: 'helix',\n ...this._callOptions,\n query: {\n ...this._callOptions.query,\n [this._queryParamName]: ids,\n },\n });\n }\n}\n__decorate([\n Enumerable(false)\n], HelixRequestBatcher.prototype, \"_client\", void 0);\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { rtfm } from '@twurple/common';\nif (!Object.prototype.hasOwnProperty.call(Symbol, 'asyncIterator')) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unnecessary-condition,@typescript-eslint/no-unsafe-member-access\n Symbol.asyncIterator = Symbol.asyncIterator ?? Symbol.for('Symbol.asyncIterator');\n}\n/**\n * Represents a request to the new Twitch API (Helix) that utilizes a cursor to paginate through its results.\n *\n * Aside from the methods described below, you can also utilize the async iterator using `for await .. of`:\n *\n * ```ts\n * const result = client.videos.getVideosByUserPaginated('125328655');\n * for await (const video of result) {\n * console.log(video.title);\n * }\n * ```\n */\nlet HelixPaginatedRequest = class HelixPaginatedRequest {\n _callOptions;\n _mapper;\n _limitPerPage;\n /** @internal */ _client;\n /** @internal */ _currentCursor;\n /** @internal */ _isFinished = false;\n /** @internal */ _currentData;\n /** @internal */\n constructor(_callOptions, client, _mapper, _limitPerPage = 100) {\n this._callOptions = _callOptions;\n this._mapper = _mapper;\n this._limitPerPage = _limitPerPage;\n this._client = client;\n }\n /**\n * The last fetched page of data associated to the requested resource.\n *\n * Only works with {@link HelixPaginatedRequest#getNext} and not with any other methods of data fetching.\n */\n get current() {\n return this._currentData?.data;\n }\n /**\n * Gets the next available page of data associated to the requested resource, or an empty array if there are no more available pages.\n */\n async getNext() {\n if (this._isFinished) {\n return [];\n }\n const result = await this._fetchData();\n // should never be null, but in practice is sometimes\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!result.data?.length) {\n this._isFinished = true;\n return [];\n }\n return this._processResult(result);\n }\n /**\n * Gets all data associated to the requested resource.\n *\n * Be aware that this makes multiple calls to the Twitch API. Due to this, you might be more suspectible to rate limits.\n *\n * Also be aware that this resets the internal cursor, so avoid using this and {@link HelixPaginatedRequest#getNext}} together.\n */\n async getAll() {\n this.reset();\n const result = [];\n do {\n const data = await this.getNext();\n if (!data.length) {\n break;\n }\n result.push(...data);\n } while (this._currentCursor);\n this.reset();\n return result;\n }\n /**\n * Gets the current cursor.\n *\n * Only useful if you want to make manual requests to the API.\n */\n get currentCursor() {\n return this._currentCursor;\n }\n /**\n * Resets the internal cursor.\n *\n * This will make {@link HelixPaginatedRequest#getNext}} start from the first page again.\n */\n reset() {\n this._currentCursor = undefined;\n this._isFinished = false;\n this._currentData = undefined;\n }\n async *[Symbol.asyncIterator]() {\n this.reset();\n while (true) {\n const data = await this.getNext();\n if (!data.length) {\n break;\n }\n yield* data[Symbol.iterator]();\n }\n }\n /** @internal */\n async _fetchData(additionalOptions = {}) {\n return await this._client.callApi({\n type: 'helix',\n ...this._callOptions,\n ...additionalOptions,\n query: {\n ...this._callOptions.query,\n after: this._currentCursor,\n first: this._limitPerPage.toString(),\n ...additionalOptions.query,\n },\n });\n }\n /** @internal */\n _processResult(result) {\n this._currentCursor = typeof result.pagination === 'string' ? result.pagination : result.pagination?.cursor;\n if (this._currentCursor === undefined) {\n this._isFinished = true;\n }\n this._currentData = result;\n return result.data.reduce((acc, elem) => {\n const mapped = this._mapper(elem);\n return Array.isArray(mapped) ? [...acc, ...mapped] : [...acc, mapped];\n }, []);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixPaginatedRequest.prototype, \"_client\", void 0);\nHelixPaginatedRequest = __decorate([\n rtfm('api', 'HelixPaginatedRequest')\n], HelixPaginatedRequest);\nexport { HelixPaginatedRequest };\n", "import { __decorate } from \"tslib\";\nimport { rtfm } from '@twurple/common';\nimport { HelixPaginatedRequest } from './HelixPaginatedRequest.js';\n/**\n * A special case of {@link HelixPaginatedRequest} with support for fetching the total number of entities, whenever an endpoint supports it.\n *\n * @inheritDoc\n */\nlet HelixPaginatedRequestWithTotal = class HelixPaginatedRequestWithTotal extends HelixPaginatedRequest {\n /**\n * Gets the total number of entities existing in the queried result set.\n */\n async getTotalCount() {\n const data = this._currentData ??\n (await this._fetchData({ query: { after: undefined } }));\n return data.total;\n }\n};\nHelixPaginatedRequestWithTotal = __decorate([\n rtfm('api', 'HelixPaginatedRequestWithTotal')\n], HelixPaginatedRequestWithTotal);\nexport { HelixPaginatedRequestWithTotal };\n", "/** @internal */ export function createPaginatedResult(response, type, client) {\n let dataCache = undefined;\n return {\n get data() {\n return (dataCache ??= response.data?.map(data => new type(data, client)) ?? []);\n },\n cursor: typeof response.pagination === 'string' ? response.pagination : response.pagination?.cursor,\n };\n}\n/** @internal */ export function createPaginatedResultWithTotal(response, type, client) {\n let dataCache = undefined;\n return {\n get data() {\n return (dataCache ??= response.data?.map(data => new type(data, client)) ?? []);\n },\n cursor: response.pagination.cursor,\n total: response.total,\n };\n}\n", "/** @internal */\nexport function createPaginationQuery({ after, before, limit } = {}) {\n return {\n after,\n before,\n first: limit?.toString(),\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A Twitch channel.\n */\nlet HelixChannel = class HelixChannel extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the channel.\n */\n get id() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the channel.\n */\n get name() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the channel.\n */\n get displayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the broadcaster of the channel.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The language of the channel.\n */\n get language() {\n return this[rawDataSymbol].broadcaster_language;\n }\n /**\n * The ID of the game currently played on the channel.\n */\n get gameId() {\n return this[rawDataSymbol].game_id;\n }\n /**\n * The name of the game currently played on the channel.\n */\n get gameName() {\n return this[rawDataSymbol].game_name;\n }\n /**\n * Gets information about the game that is being played on the stream.\n */\n async getGame() {\n return this[rawDataSymbol].game_id\n ? checkRelationAssertion(await this._client.games.getGameById(this[rawDataSymbol].game_id))\n : null;\n }\n /**\n * The title of the channel.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The stream delay of the channel, in seconds.\n *\n * If you didn't request this with broadcaster access, this is always zero.\n */\n get delay() {\n return this[rawDataSymbol].delay;\n }\n /**\n * The tags applied to the channel.\n */\n get tags() {\n return this[rawDataSymbol].tags;\n }\n /**\n * The content classification labels applied to the channel.\n */\n get contentClassificationLabels() {\n return this[rawDataSymbol].content_classification_labels;\n }\n /**\n * Whether the channel currently displays branded content (as specified by the broadcaster).\n */\n get isBrandedContent() {\n return this[rawDataSymbol].is_branded_content;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixChannel.prototype, \"_client\", void 0);\nHelixChannel = __decorate([\n rtfm('api', 'HelixChannel', 'id')\n], HelixChannel);\nexport { HelixChannel };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * An editor of a previously given channel.\n */\nlet HelixChannelEditor = class HelixChannelEditor extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the user.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The display name of the user.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets additional information about the user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * The date when the user was given editor status.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixChannelEditor.prototype, \"_client\", void 0);\nHelixChannelEditor = __decorate([\n rtfm('api', 'HelixChannelEditor', 'userId')\n], HelixChannelEditor);\nexport { HelixChannelEditor };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Represents a user that follows a channel.\n */\nlet HelixChannelFollower = class HelixChannelFollower extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the user.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets additional information about the user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * The date when the user followed the broadcaster.\n */\n get followDate() {\n return new Date(this[rawDataSymbol].followed_at);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixChannelFollower.prototype, \"_client\", void 0);\nHelixChannelFollower = __decorate([\n rtfm('api', 'HelixChannelFollower', 'userId')\n], HelixChannelFollower);\nexport { HelixChannelFollower };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Represents a broadcaster that a user follows.\n */\nlet HelixFollowedChannel = class HelixFollowedChannel extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the broadcaster.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the broadcaster.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets additional information about the broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The date when the user followed the broadcaster.\n */\n get followDate() {\n return new Date(this[rawDataSymbol].followed_at);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixFollowedChannel.prototype, \"_client\", void 0);\nHelixFollowedChannel = __decorate([\n rtfm('api', 'HelixFollowedChannel', 'broadcasterId')\n], HelixFollowedChannel);\nexport { HelixFollowedChannel };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Represents a broadcaster's ad schedule.\n */\nlet HelixAdSchedule = class HelixAdSchedule extends DataObject {\n /**\n * The number of snoozes available for the broadcaster.\n */\n get snoozeCount() {\n return this[rawDataSymbol].snooze_count;\n }\n /**\n * The date and time when the broadcaster will gain an additional snooze.\n * Returns `null` if all snoozes are already available.\n */\n get snoozeRefreshDate() {\n return this[rawDataSymbol].snooze_refresh_at ? new Date(this[rawDataSymbol].snooze_refresh_at * 1000) : null;\n }\n /**\n * The date and time of the broadcaster's next scheduled ad.\n * Returns `null` if channel is not live or has no ad scheduled.\n */\n get nextAdDate() {\n return this[rawDataSymbol].next_ad_at ? new Date(this[rawDataSymbol].next_ad_at * 1000) : null;\n }\n /**\n * The length in seconds of the scheduled upcoming ad break.\n */\n get duration() {\n return this[rawDataSymbol].duration;\n }\n /**\n * The date and time of the broadcaster's last ad-break.\n * Returns `null` if channel is not live or has not run an ad.\n */\n get lastAdDate() {\n return this[rawDataSymbol].last_ad_at ? new Date(this[rawDataSymbol].last_ad_at * 1000) : null;\n }\n /**\n * The amount of pre-roll free time remaining for the channel in seconds.\n */\n get prerollFreeTime() {\n return this[rawDataSymbol].preroll_free_time;\n }\n};\nHelixAdSchedule = __decorate([\n rtfm('api', 'HelixAdSchedule')\n], HelixAdSchedule);\nexport { HelixAdSchedule };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Represents the result after a call to snooze the broadcaster's ad schedule.\n */\nlet HelixSnoozeNextAdResult = class HelixSnoozeNextAdResult extends DataObject {\n /**\n * The number of snoozes remaining for the broadcaster.\n */\n get snoozeCount() {\n return this[rawDataSymbol].snooze_count;\n }\n /**\n * The date and time when the broadcaster will gain an additional snooze.\n */\n get snoozeRefreshDate() {\n return new Date(this[rawDataSymbol].snooze_refresh_at * 1000);\n }\n /**\n * The date and time of the broadcaster's next scheduled ad.\n */\n get nextAdDate() {\n return new Date(this[rawDataSymbol].next_ad_at * 1000);\n }\n};\nHelixSnoozeNextAdResult = __decorate([\n rtfm('api', 'HelixSnoozeNextAdResult')\n], HelixSnoozeNextAdResult);\nexport { HelixSnoozeNextAdResult };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable, mapNullable } from '@d-fischer/shared-utils';\nimport { createBroadcasterQuery, } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createChannelCommercialBody, createChannelFollowerQuery, createChannelUpdateBody, createChannelVipUpdateQuery, createFollowedChannelQuery, } from '../../interfaces/endpoints/channel.external.js';\nimport { createChannelUsersCheckQuery, createSingleKeyQuery, } from '../../interfaces/endpoints/generic.external.js';\nimport { HelixUserRelation } from '../../relations/HelixUserRelation.js';\nimport { HelixRequestBatcher } from '../../utils/HelixRequestBatcher.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { HelixPaginatedRequestWithTotal } from '../../utils/pagination/HelixPaginatedRequestWithTotal.js';\nimport { createPaginatedResult, createPaginatedResultWithTotal, } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixChannel } from './HelixChannel.js';\nimport { HelixChannelEditor } from './HelixChannelEditor.js';\nimport { HelixChannelFollower } from './HelixChannelFollower.js';\nimport { HelixFollowedChannel } from './HelixFollowedChannel.js';\nimport { HelixAdSchedule } from './HelixAdSchedule.js';\nimport { HelixSnoozeNextAdResult } from './HelixSnoozeNextAdResult.js';\n/**\n * The Helix API methods that deal with channels.\n *\n * Can be accessed using `client.channels` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const channel = await api.channels.getChannelInfoById('125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Channels\n */\nlet HelixChannelApi = class HelixChannelApi extends BaseApi {\n /** @internal */\n _getChannelByIdBatcher = new HelixRequestBatcher({\n url: 'channels',\n }, 'broadcaster_id', 'broadcaster_id', this._client, (data) => new HelixChannel(data, this._client));\n /**\n * Gets the channel data for the given user.\n *\n * @param user The user you want to get channel info for.\n */\n async getChannelInfoById(user) {\n const userId = extractUserId(user);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channels',\n userId,\n query: createBroadcasterQuery(userId),\n });\n return mapNullable(result.data[0], data => new HelixChannel(data, this._client));\n }\n /**\n * Gets the channel data for the given user, batching multiple calls into fewer requests as the API allows.\n *\n * @param user The user you want to get channel info for.\n */\n async getChannelInfoByIdBatched(user) {\n return await this._getChannelByIdBatcher.request(extractUserId(user));\n }\n /**\n * Gets the channel data for the given users.\n *\n * @param users The users you want to get channel info for.\n */\n async getChannelInfoByIds(users) {\n const userIds = users.map(extractUserId);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channels',\n query: createSingleKeyQuery('broadcaster_id', userIds),\n });\n return result.data.map(data => new HelixChannel(data, this._client));\n }\n /**\n * Updates the given user's channel data.\n *\n * @param user The user you want to update channel info for.\n * @param data The channel info to set.\n */\n async updateChannelInfo(user, data) {\n await this._client.callApi({\n type: 'helix',\n url: 'channels',\n method: 'PATCH',\n userId: extractUserId(user),\n scopes: ['channel:manage:broadcast'],\n query: createBroadcasterQuery(user),\n jsonBody: createChannelUpdateBody(data),\n });\n }\n /**\n * Starts a commercial on a channel.\n *\n * @param broadcaster The broadcaster on whose channel the commercial is started.\n * @param length The length of the commercial, in seconds.\n */\n async startChannelCommercial(broadcaster, length) {\n await this._client.callApi({\n type: 'helix',\n url: 'channels/commercial',\n method: 'POST',\n userId: extractUserId(broadcaster),\n scopes: ['channel:edit:commercial'],\n jsonBody: createChannelCommercialBody(broadcaster, length),\n });\n }\n /**\n * Gets a list of users who have editor permissions on your channel.\n *\n * @param broadcaster The broadcaster to retreive the editors for.\n */\n async getChannelEditors(broadcaster) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channels/editors',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:editors'],\n query: createBroadcasterQuery(broadcaster),\n });\n return result.data.map(data => new HelixChannelEditor(data, this._client));\n }\n /**\n * Gets a list of VIPs in a channel.\n *\n * @param broadcaster The owner of the channel to get VIPs for.\n * @param pagination\n *\n * @expandParams\n */\n async getVips(broadcaster, pagination) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'channels/vips',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:vips', 'channel:manage:vips'],\n query: {\n ...createBroadcasterQuery(broadcaster),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResult(response, HelixUserRelation, this._client);\n }\n /**\n * Creates a paginator for VIPs in a channel.\n *\n * @param broadcaster The owner of the channel to get VIPs for.\n */\n getVipsPaginated(broadcaster) {\n return new HelixPaginatedRequest({\n url: 'channels/vips',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:vips', 'channel:manage:vips'],\n query: createBroadcasterQuery(broadcaster),\n }, this._client, data => new HelixUserRelation(data, this._client));\n }\n /**\n * Checks the VIP status of a list of users in a channel.\n *\n * @param broadcaster The owner of the channel to check VIP status in.\n * @param users The users to check.\n */\n async checkVipForUsers(broadcaster, users) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'channels/vips',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:vips', 'channel:manage:vips'],\n query: createChannelUsersCheckQuery(broadcaster, users),\n });\n return response.data.map(data => new HelixUserRelation(data, this._client));\n }\n /**\n * Checks the VIP status of a user in a channel.\n *\n * @param broadcaster The owner of the channel to check VIP status in.\n * @param user The user to check.\n */\n async checkVipForUser(broadcaster, user) {\n const userId = extractUserId(user);\n const result = await this.checkVipForUsers(broadcaster, [userId]);\n return result.some(rel => rel.id === userId);\n }\n /**\n * Adds a VIP to the broadcaster\u2019s chat room.\n *\n * @param broadcaster The broadcaster that\u2019s granting VIP status to the user. This ID must match the user ID in the access token.\n * @param user The user to add as a VIP in the broadcaster\u2019s chat room.\n */\n async addVip(broadcaster, user) {\n await this._client.callApi({\n type: 'helix',\n url: 'channels/vips',\n method: 'POST',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:vips'],\n query: createChannelVipUpdateQuery(broadcaster, user),\n });\n }\n /**\n * Removes a VIP from the broadcaster\u2019s chat room.\n *\n * @param broadcaster The broadcaster that\u2019s removing VIP status from the user. This ID must match the user ID in the access token.\n * @param user The user to remove as a VIP from the broadcaster\u2019s chat room.\n */\n async removeVip(broadcaster, user) {\n await this._client.callApi({\n type: 'helix',\n url: 'channels/vips',\n method: 'DELETE',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:vips'],\n query: createChannelVipUpdateQuery(broadcaster, user),\n });\n }\n /**\n * Gets the total number of users that follow the specified broadcaster.\n *\n * @param broadcaster The broadcaster you want to get the number of followers of.\n */\n async getChannelFollowerCount(broadcaster) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channels/followers',\n method: 'GET',\n userId: extractUserId(broadcaster),\n query: {\n ...createChannelFollowerQuery(broadcaster),\n ...createPaginationQuery({ limit: 1 }),\n },\n });\n return result.total;\n }\n /**\n * Gets a list of users that follow the specified broadcaster.\n * You can also use this endpoint to see whether a specific user follows the broadcaster.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster you want to get a list of followers for.\n * @param user An optional user to determine if this user follows the broadcaster.\n * If specified, the response contains this user if they follow the broadcaster.\n * If not specified, the response contains all users that follow the broadcaster.\n * @param pagination\n *\n * @expandParams\n */\n async getChannelFollowers(broadcaster, user, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channels/followers',\n method: 'GET',\n userId: extractUserId(broadcaster),\n canOverrideScopedUserContext: true,\n scopes: ['moderator:read:followers'],\n query: {\n ...createChannelFollowerQuery(broadcaster, user),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResultWithTotal(result, HelixChannelFollower, this._client);\n }\n /**\n * Creates a paginator for users that follow the specified broadcaster.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster for whom you are getting a list of followers.\n *\n * @expandParams\n */\n getChannelFollowersPaginated(broadcaster) {\n return new HelixPaginatedRequestWithTotal({\n url: 'channels/followers',\n method: 'GET',\n userId: extractUserId(broadcaster),\n canOverrideScopedUserContext: true,\n scopes: ['moderator:read:followers'],\n query: createChannelFollowerQuery(broadcaster),\n }, this._client, data => new HelixChannelFollower(data, this._client));\n }\n /**\n * Gets a list of broadcasters that the specified user follows.\n * You can also use this endpoint to see whether the user follows a specific broadcaster.\n *\n * @param user The user that's getting a list of followed channels.\n * This ID must match the user ID in the access token.\n * @param broadcaster An optional broadcaster to determine if the user follows this broadcaster.\n * If specified, the response contains this broadcaster if the user follows them.\n * If not specified, the response contains all broadcasters that the user follows.\n * @param pagination\n * @returns\n */\n async getFollowedChannels(user, broadcaster, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channels/followed',\n method: 'GET',\n userId: extractUserId(user),\n scopes: ['user:read:follows'],\n query: {\n ...createFollowedChannelQuery(user, broadcaster),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResultWithTotal(result, HelixFollowedChannel, this._client);\n }\n /**\n * Creates a paginator for broadcasters that the specified user follows.\n *\n * @param user The user that's getting a list of followed channels.\n * The token of this user will be used to get the list of followed channels.\n * @param broadcaster An optional broadcaster to determine if the user follows this broadcaster.\n * If specified, the response contains this broadcaster if the user follows them.\n * If not specified, the response contains all broadcasters that the user follows.\n * @returns\n */\n getFollowedChannelsPaginated(user, broadcaster) {\n return new HelixPaginatedRequestWithTotal({\n url: 'channels/followed',\n method: 'GET',\n userId: extractUserId(user),\n scopes: ['user:read:follows'],\n query: createFollowedChannelQuery(user, broadcaster),\n }, this._client, data => new HelixFollowedChannel(data, this._client));\n }\n /**\n * Gets information about the broadcaster's ad schedule.\n *\n * @param broadcaster The broadcaster to get ad schedule information about.\n */\n async getAdSchedule(broadcaster) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'channels/ads',\n method: 'GET',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:ads'],\n query: createBroadcasterQuery(broadcaster),\n });\n return new HelixAdSchedule(response.data[0]);\n }\n /**\n * Snoozes the broadcaster's next ad, if a snooze is available.\n *\n * @param broadcaster The broadcaster to get ad schedule information about.\n */\n async snoozeNextAd(broadcaster) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'channels/ads/schedule/snooze',\n method: 'POST',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:ads'],\n query: createBroadcasterQuery(broadcaster),\n });\n return new HelixSnoozeNextAdResult(response.data[0]);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixChannelApi.prototype, \"_getChannelByIdBatcher\", void 0);\nHelixChannelApi = __decorate([\n rtfm('api', 'HelixChannelApi')\n], HelixChannelApi);\nexport { HelixChannelApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createCustomRewardsQuery(broadcaster, onlyManageable) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n only_manageable_rewards: onlyManageable?.toString(),\n };\n}\n/** @internal */\nexport function createCustomRewardChangeQuery(broadcaster, rewardId) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n id: rewardId,\n };\n}\n/** @internal */\nexport function createCustomRewardBody(data) {\n const result = {\n title: data.title,\n cost: data.cost,\n prompt: data.prompt,\n background_color: data.backgroundColor,\n is_enabled: data.isEnabled,\n is_user_input_required: data.userInputRequired,\n should_redemptions_skip_request_queue: data.autoFulfill,\n };\n if (data.maxRedemptionsPerStream !== undefined) {\n result.is_max_per_stream_enabled = !!data.maxRedemptionsPerStream;\n result.max_per_stream = data.maxRedemptionsPerStream ?? 0;\n }\n if (data.maxRedemptionsPerUserPerStream !== undefined) {\n result.is_max_per_user_per_stream_enabled = !!data.maxRedemptionsPerUserPerStream;\n result.max_per_user_per_stream = data.maxRedemptionsPerUserPerStream ?? 0;\n }\n if (data.globalCooldown !== undefined) {\n result.is_global_cooldown_enabled = !!data.globalCooldown;\n result.global_cooldown_seconds = data.globalCooldown ?? 0;\n }\n if ('isPaused' in data) {\n result.is_paused = data.isPaused;\n }\n return result;\n}\n/** @internal */\nexport function createRewardRedemptionsByIdsQuery(broadcaster, rewardId, redemptionIds) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n reward_id: rewardId,\n id: redemptionIds,\n };\n}\n/** @internal */\nexport function createRedemptionsForBroadcasterQuery(broadcaster, rewardId, status, filter) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n reward_id: rewardId,\n status,\n sort: filter.newestFirst ? 'NEWEST' : 'OLDEST',\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A custom Channel Points reward.\n */\nlet HelixCustomReward = class HelixCustomReward extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the reward.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the broadcaster the reward belongs to.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster the reward belongs to.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the broadcaster the reward belongs to.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the reward's broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * Gets the URL of the image of the reward in the given scale.\n *\n * @param scale The scale of the image.\n */\n getImageUrl(scale) {\n const urlProp = `url_${scale}x`;\n return this[rawDataSymbol].image?.[urlProp] ?? this[rawDataSymbol].default_image[urlProp];\n }\n /**\n * The background color of the reward.\n */\n get backgroundColor() {\n return this[rawDataSymbol].background_color;\n }\n /**\n * Whether the reward is enabled (shown to users).\n */\n get isEnabled() {\n return this[rawDataSymbol].is_enabled;\n }\n /**\n * The channel points cost of the reward.\n */\n get cost() {\n return this[rawDataSymbol].cost;\n }\n /**\n * The title of the reward.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The prompt shown to users when redeeming the reward.\n */\n get prompt() {\n return this[rawDataSymbol].prompt;\n }\n /**\n * Whether the reward requires user input to be redeemed.\n */\n get userInputRequired() {\n return this[rawDataSymbol].is_user_input_required;\n }\n /**\n * The maximum number of redemptions of the reward per stream. `null` means no limit.\n */\n get maxRedemptionsPerStream() {\n return this[rawDataSymbol].max_per_stream_setting.is_enabled\n ? this[rawDataSymbol].max_per_stream_setting.max_per_stream\n : null;\n }\n /**\n * The maximum number of redemptions of the reward per stream for each user. `null` means no limit.\n */\n get maxRedemptionsPerUserPerStream() {\n return this[rawDataSymbol].max_per_user_per_stream_setting.is_enabled\n ? this[rawDataSymbol].max_per_user_per_stream_setting.max_per_user_per_stream\n : null;\n }\n /**\n * The cooldown between two redemptions of the reward, in seconds. `null` means no cooldown.\n */\n get globalCooldown() {\n return this[rawDataSymbol].global_cooldown_setting.is_enabled\n ? this[rawDataSymbol].global_cooldown_setting.global_cooldown_seconds\n : null;\n }\n /**\n * Whether the reward is paused. If true, users can't redeem it.\n */\n get isPaused() {\n return this[rawDataSymbol].is_paused;\n }\n /**\n * Whether the reward is currently in stock.\n */\n get isInStock() {\n return this[rawDataSymbol].is_in_stock;\n }\n /**\n * How often the reward was already redeemed this stream.\n *\n * Only available when the stream is live and `maxRedemptionsPerStream` is set. Otherwise, this is `null`.\n */\n get redemptionsThisStream() {\n return this[rawDataSymbol].redemptions_redeemed_current_stream;\n }\n /**\n * Whether redemptions should automatically be marked as fulfilled.\n */\n get autoFulfill() {\n return this[rawDataSymbol].should_redemptions_skip_request_queue;\n }\n /**\n * The time when the cooldown ends. `null` means there is currently no cooldown.\n */\n get cooldownExpiryDate() {\n return this[rawDataSymbol].cooldown_expires_at ? new Date(this[rawDataSymbol].cooldown_expires_at) : null;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixCustomReward.prototype, \"_client\", void 0);\nHelixCustomReward = __decorate([\n rtfm('api', 'HelixCustomReward', 'id')\n], HelixCustomReward);\nexport { HelixCustomReward };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A redemption of a custom Channel Points reward.\n */\nlet HelixCustomRewardRedemption = class HelixCustomRewardRedemption extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the redemption.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the broadcaster where the reward was redeemed.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster where the reward was redeemed.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the broadcaster where the reward was redeemed.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the broadcaster where the reward was redeemed.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The ID of the user that redeemed the reward.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user that redeemed the reward.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user that redeemed the reward.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets more information about the user that redeemed the reward.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * The text the user wrote when redeeming the reward.\n */\n get userInput() {\n return this[rawDataSymbol].user_input;\n }\n /**\n * Whether the redemption was fulfilled.\n */\n get isFulfilled() {\n return this[rawDataSymbol].status === 'FULFILLED';\n }\n /**\n * Whether the redemption was canceled.\n */\n get isCanceled() {\n return this[rawDataSymbol].status === 'CANCELED';\n }\n /**\n * The date and time when the reward was redeemed.\n */\n get redemptionDate() {\n return new Date(this[rawDataSymbol].redeemed_at);\n }\n /**\n * The ID of the reward that was redeemed.\n */\n get rewardId() {\n return this[rawDataSymbol].reward.id;\n }\n /**\n * The title of the reward that was redeemed.\n */\n get rewardTitle() {\n return this[rawDataSymbol].reward.title;\n }\n /**\n * The prompt of the reward that was redeemed.\n */\n get rewardPrompt() {\n return this[rawDataSymbol].reward.prompt;\n }\n /**\n * The cost of the reward that was redeemed.\n */\n get rewardCost() {\n return this[rawDataSymbol].reward.cost;\n }\n /**\n * Gets more information about the reward that was redeemed.\n */\n async getReward() {\n return checkRelationAssertion(await this._client.channelPoints.getCustomRewardById(this[rawDataSymbol].broadcaster_id, this[rawDataSymbol].reward.id));\n }\n /**\n * Updates the redemption's status.\n *\n * @param newStatus The status the redemption should have.\n */\n async updateStatus(newStatus) {\n const result = await this._client.channelPoints.updateRedemptionStatusByIds(this[rawDataSymbol].broadcaster_id, this[rawDataSymbol].reward.id, [this[rawDataSymbol].id], newStatus);\n return result[0];\n }\n};\n__decorate([\n Enumerable(false)\n], HelixCustomRewardRedemption.prototype, \"_client\", void 0);\nHelixCustomRewardRedemption = __decorate([\n rtfm('api', 'HelixCustomRewardRedemption', 'id')\n], HelixCustomRewardRedemption);\nexport { HelixCustomRewardRedemption };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createCustomRewardBody, createCustomRewardChangeQuery, createCustomRewardsQuery, createRedemptionsForBroadcasterQuery, createRewardRedemptionsByIdsQuery, } from '../../interfaces/endpoints/channelPoints.external.js';\nimport { createGetByIdsQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixCustomReward } from './HelixCustomReward.js';\nimport { HelixCustomRewardRedemption } from './HelixCustomRewardRedemption.js';\n/**\n * The Helix API methods that deal with channel points.\n *\n * Can be accessed using `client.channelPoints` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const rewards = await api.channelPoints.getCustomRewards('125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Channel points\n */\nlet HelixChannelPointsApi = class HelixChannelPointsApi extends BaseApi {\n /**\n * Gets all custom rewards for the given broadcaster.\n *\n * @param broadcaster The broadcaster to get the rewards for.\n * @param onlyManageable Whether to only get rewards that can be managed by the API.\n */\n async getCustomRewards(broadcaster, onlyManageable) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channel_points/custom_rewards',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:redemptions', 'channel:manage:redemptions'],\n query: createCustomRewardsQuery(broadcaster, onlyManageable),\n });\n return result.data.map(data => new HelixCustomReward(data, this._client));\n }\n /**\n * Gets custom rewards by IDs.\n *\n * @param broadcaster The broadcaster to get the rewards for.\n * @param rewardIds The IDs of the rewards.\n */\n async getCustomRewardsByIds(broadcaster, rewardIds) {\n if (!rewardIds.length) {\n return [];\n }\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channel_points/custom_rewards',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:redemptions', 'channel:manage:redemptions'],\n query: createGetByIdsQuery(broadcaster, rewardIds),\n });\n return result.data.map(data => new HelixCustomReward(data, this._client));\n }\n /**\n * Gets a custom reward by ID.\n *\n * @param broadcaster The broadcaster to get the reward for.\n * @param rewardId The ID of the reward.\n */\n async getCustomRewardById(broadcaster, rewardId) {\n const rewards = await this.getCustomRewardsByIds(broadcaster, [rewardId]);\n return rewards.length ? rewards[0] : null;\n }\n /**\n * Creates a new custom reward.\n *\n * @param broadcaster The broadcaster to create the reward for.\n * @param data The reward data.\n *\n * @expandParams\n */\n async createCustomReward(broadcaster, data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channel_points/custom_rewards',\n method: 'POST',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:redemptions'],\n query: createBroadcasterQuery(broadcaster),\n jsonBody: createCustomRewardBody(data),\n });\n return new HelixCustomReward(result.data[0], this._client);\n }\n /**\n * Updates a custom reward.\n *\n * @param broadcaster The broadcaster to update the reward for.\n * @param rewardId The ID of the reward.\n * @param data The reward data.\n */\n async updateCustomReward(broadcaster, rewardId, data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channel_points/custom_rewards',\n method: 'PATCH',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:redemptions'],\n query: createCustomRewardChangeQuery(broadcaster, rewardId),\n jsonBody: createCustomRewardBody(data),\n });\n return new HelixCustomReward(result.data[0], this._client);\n }\n /**\n * Deletes a custom reward.\n *\n * @param broadcaster The broadcaster to delete the reward for.\n * @param rewardId The ID of the reward.\n */\n async deleteCustomReward(broadcaster, rewardId) {\n await this._client.callApi({\n type: 'helix',\n url: 'channel_points/custom_rewards',\n method: 'DELETE',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:redemptions'],\n query: createCustomRewardChangeQuery(broadcaster, rewardId),\n });\n }\n /**\n * Gets custom reward redemptions by IDs.\n *\n * @param broadcaster The broadcaster to get the redemptions for.\n * @param rewardId The ID of the reward.\n * @param redemptionIds The IDs of the redemptions.\n */\n async getRedemptionsByIds(broadcaster, rewardId, redemptionIds) {\n if (!redemptionIds.length) {\n return [];\n }\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channel_points/custom_rewards/redemptions',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:redemptions', 'channel:manage:redemptions'],\n query: createRewardRedemptionsByIdsQuery(broadcaster, rewardId, redemptionIds),\n });\n return result.data.map(data => new HelixCustomRewardRedemption(data, this._client));\n }\n /**\n * Gets a custom reward redemption by ID.\n *\n * @param broadcaster The broadcaster to get the redemption for.\n * @param rewardId The ID of the reward.\n * @param redemptionId The ID of the redemption.\n */\n async getRedemptionById(broadcaster, rewardId, redemptionId) {\n const redemptions = await this.getRedemptionsByIds(broadcaster, rewardId, [redemptionId]);\n return redemptions.length ? redemptions[0] : null;\n }\n /**\n * Gets custom reward redemptions for the given broadcaster.\n *\n * @param broadcaster The broadcaster to get the redemptions for.\n * @param rewardId The ID of the reward.\n * @param status The status of the redemptions to get.\n * @param filter\n *\n * @expandParams\n */\n async getRedemptionsForBroadcaster(broadcaster, rewardId, status, filter) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channel_points/custom_rewards/redemptions',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:redemptions', 'channel:manage:redemptions'],\n query: {\n ...createRedemptionsForBroadcasterQuery(broadcaster, rewardId, status, filter),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixCustomRewardRedemption, this._client);\n }\n /**\n * Creates a paginator for custom reward redemptions for the given broadcaster.\n *\n * @param broadcaster The broadcaster to get the redemptions for.\n * @param rewardId The ID of the reward.\n * @param status The status of the redemptions to get.\n * @param filter\n *\n * @expandParams\n */\n getRedemptionsForBroadcasterPaginated(broadcaster, rewardId, status, filter) {\n return new HelixPaginatedRequest({\n url: 'channel_points/custom_rewards/redemptions',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:redemptions', 'channel:manage:redemptions'],\n query: createRedemptionsForBroadcasterQuery(broadcaster, rewardId, status, filter),\n }, this._client, data => new HelixCustomRewardRedemption(data, this._client), 50);\n }\n /**\n * Updates the status of the given redemptions by IDs.\n *\n * @param broadcaster The broadcaster to update the redemptions for.\n * @param rewardId The ID of the reward.\n * @param redemptionIds The IDs of the redemptions to update.\n * @param status The status to set for the redemptions.\n */\n async updateRedemptionStatusByIds(broadcaster, rewardId, redemptionIds, status) {\n if (!redemptionIds.length) {\n return [];\n }\n const result = await this._client.callApi({\n type: 'helix',\n url: 'channel_points/custom_rewards/redemptions',\n method: 'PATCH',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:redemptions'],\n query: createRewardRedemptionsByIdsQuery(broadcaster, rewardId, redemptionIds),\n jsonBody: {\n status,\n },\n });\n return result.data.map(data => new HelixCustomRewardRedemption(data, this._client));\n }\n};\nHelixChannelPointsApi = __decorate([\n rtfm('api', 'HelixChannelPointsApi')\n], HelixChannelPointsApi);\nexport { HelixChannelPointsApi };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * An object representing monetary amount and currency information for charity donations/goals.\n */\nlet HelixCharityCampaignAmount = class HelixCharityCampaignAmount extends DataObject {\n /**\n * The monetary amount. The amount is specified in the currency\u2019s minor unit.\n * For example, the minor units for USD is cents, so if the amount is $5.50 USD, `value` is set to 550.\n */\n get value() {\n return this[rawDataSymbol].value;\n }\n /**\n * The number of decimal places used by the currency. For example, USD uses two decimal places.\n * Use this number to translate `value` from minor units to major units by using the formula:\n *\n * `value / 10^decimalPlaces`\n */\n get decimalPlaces() {\n return this[rawDataSymbol].decimal_places;\n }\n /**\n * The localized monetary amount based on the value and the decimal places of the currency.\n * For example, the minor units for USD is cents which uses two decimal places, so if `value` is 550, `localizedValue` is set to 5.50.\n */\n get localizedValue() {\n return this.value / 10 ** this.decimalPlaces;\n }\n /**\n * The ISO-4217 three-letter currency code that identifies the type of currency in `value`.\n */\n get currency() {\n return this[rawDataSymbol].currency;\n }\n};\nHelixCharityCampaignAmount = __decorate([\n rtfm('api', 'HelixCharityCampaignAmount')\n], HelixCharityCampaignAmount);\nexport { HelixCharityCampaignAmount };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixCharityCampaignAmount } from './HelixCharityCampaignAmount.js';\n/**\n * A charity campaign in a Twitch channel.\n */\nlet HelixCharityCampaign = class HelixCharityCampaign extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * An ID that identifies the charity campaign.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the broadcaster.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the broadcaster.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The name of the charity.\n */\n get charityName() {\n return this[rawDataSymbol].charity_name;\n }\n /**\n * A description of the charity.\n */\n get charityDescription() {\n return this[rawDataSymbol].charity_description;\n }\n /**\n * A URL to an image of the charity's logo. The image\u2019s type is PNG and its size is 100px X 100px.\n */\n get charityLogo() {\n return this[rawDataSymbol].charity_logo;\n }\n /**\n * A URL to the charity\u2019s website.\n */\n get charityWebsite() {\n return this[rawDataSymbol].charity_website;\n }\n /**\n * An object that contains the current amount of donations that the campaign has received.\n */\n get currentAmount() {\n return new HelixCharityCampaignAmount(this[rawDataSymbol].current_amount);\n }\n /**\n * An object that contains the campaign\u2019s target fundraising goal.\n */\n get targetAmount() {\n return new HelixCharityCampaignAmount(this[rawDataSymbol].target_amount);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixCharityCampaign.prototype, \"_client\", void 0);\nHelixCharityCampaign = __decorate([\n rtfm('api', 'HelixCharityCampaign', 'id')\n], HelixCharityCampaign);\nexport { HelixCharityCampaign };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixCharityCampaignAmount } from './HelixCharityCampaignAmount.js';\n/**\n * A donation to a charity campaign in a Twitch channel.\n */\nlet HelixCharityCampaignDonation = class HelixCharityCampaignDonation extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * An ID that identifies the charity campaign.\n */\n get campaignId() {\n return this[rawDataSymbol].campaign_id;\n }\n /**\n * The ID of the donating user.\n */\n get donorId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the donating user.\n */\n get donorName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the donating user.\n */\n get donorDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets more information about the donating user.\n */\n async getDonor() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * An object that contains the amount of money that the user donated.\n */\n get amount() {\n return new HelixCharityCampaignAmount(this[rawDataSymbol].amount);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixCharityCampaignDonation.prototype, \"_client\", void 0);\nHelixCharityCampaignDonation = __decorate([\n rtfm('api', 'HelixCharityCampaignDonation')\n], HelixCharityCampaignDonation);\nexport { HelixCharityCampaignDonation };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixCharityCampaign } from './HelixCharityCampaign.js';\nimport { HelixCharityCampaignDonation } from './HelixCharityCampaignDonation.js';\n/**\n * The Helix API methods that deal with charity campaigns.\n *\n * Can be accessed using `client.charity` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const charityCampaign = await api.charity.getCharityCampaign('125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Charity Campaigns\n */\nlet HelixCharityApi = class HelixCharityApi extends BaseApi {\n /**\n * Gets information about the charity campaign that a broadcaster is running.\n * Returns null if the specified broadcaster has no active charity campaign.\n *\n * @param broadcaster The broadcaster to get charity campaign information about.\n */\n async getCharityCampaign(broadcaster) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'charity/campaigns',\n method: 'GET',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:charity'],\n query: createBroadcasterQuery(broadcaster),\n });\n return new HelixCharityCampaign(response.data[0], this._client);\n }\n /**\n * Gets the list of donations that users have made to the broadcaster\u2019s active charity campaign.\n *\n * @param broadcaster The broadcaster to get charity campaign donation information about.\n * @param pagination\n *\n * @expandParams\n */\n async getCharityCampaignDonations(broadcaster, pagination) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'charity/donations',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:charity'],\n query: {\n ...createBroadcasterQuery(broadcaster),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResult(response, HelixCharityCampaignDonation, this._client);\n }\n};\nHelixCharityApi = __decorate([\n rtfm('api', 'HelixCharityApi')\n], HelixCharityApi);\nexport { HelixCharityApi };\n", "import { CustomError } from '@twurple/common';\n/**\n * Thrown when a chat message is dropped and not delivered to the target channel.\n */\nexport class ChatMessageDroppedError extends CustomError {\n _code;\n constructor(broadcasterId, message, code) {\n super(`Chat message to channel ${broadcasterId} dropped: ${message ?? 'unknown reason'}`);\n this._code = code;\n }\n get code() {\n return this._code;\n }\n}\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createChatSettingsUpdateBody(settings) {\n return {\n slow_mode: settings.slowModeEnabled,\n slow_mode_wait_time: settings.slowModeDelay,\n follower_mode: settings.followerOnlyModeEnabled,\n follower_mode_duration: settings.followerOnlyModeDelay,\n subscriber_mode: settings.subscriberOnlyModeEnabled,\n emote_mode: settings.emoteOnlyModeEnabled,\n unique_chat_mode: settings.uniqueChatModeEnabled,\n non_moderator_chat_delay: settings.nonModeratorChatDelayEnabled,\n non_moderator_chat_delay_duration: settings.nonModeratorChatDelay,\n };\n}\n/** @internal */\nexport function createChatColorUpdateQuery(user, color) {\n return {\n user_id: extractUserId(user),\n color,\n };\n}\n/** @internal */\nexport function createShoutoutQuery(from, to, moderatorId) {\n return {\n from_broadcaster_id: extractUserId(from),\n to_broadcaster_id: extractUserId(to),\n moderator_id: moderatorId,\n };\n}\n/** @internal */\nexport function createSendChatMessageQuery(broadcaster, sender) {\n return {\n broadcaster_id: broadcaster,\n sender_id: sender,\n };\n}\n/** @internal */\nexport function createSendChatMessageBody(message, params) {\n return {\n message,\n reply_parent_message_id: params?.replyParentMessageId,\n };\n}\n/** @internal */\nexport function createSendChatMessageAsAppBody(message, params) {\n return {\n message,\n reply_parent_message_id: params?.replyParentMessageId,\n for_source_only: params?.forSourceOnly,\n };\n}\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createSharedChatSessionQuery(broadcaster) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n };\n}\n", "import { DataObject, rawDataSymbol } from '@twurple/common';\n/** @private */\nexport class HelixEmoteBase extends DataObject {\n /**\n * The ID of the emote.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The name of the emote.\n */\n get name() {\n return this[rawDataSymbol].name;\n }\n /**\n * The formats that the emote is available in.\n */\n get formats() {\n return this[rawDataSymbol].format;\n }\n /**\n * The scales that the emote is available in.\n */\n get scales() {\n return this[rawDataSymbol].scale;\n }\n /**\n * The theme modes that the emote is available in.\n */\n get themeModes() {\n return this[rawDataSymbol].theme_mode;\n }\n /**\n * Gets the URL of the emote image in static format at the given scale and theme mode, or null if a static emote image at that scale/theme mode doesn't exist.\n *\n * @param scale The scale of the image.\n * @param themeMode The theme mode of the image, either `light` or `dark`.\n */\n getStaticImageUrl(scale = '1.0', themeMode = 'light') {\n if (this[rawDataSymbol].format.includes('static') && this[rawDataSymbol].scale.includes(scale)) {\n return this.getFormattedImageUrl(scale, 'static', themeMode);\n }\n return null;\n }\n /**\n * Gets the URL of the emote image in animated format at the given scale and theme mode, or null if an animated emote image at that scale/theme mode doesn't exist.\n *\n * @param scale The scale of the image.\n * @param themeMode The theme mode of the image, either `light` or `dark`.\n */\n getAnimatedImageUrl(scale = '1.0', themeMode = 'light') {\n if (this[rawDataSymbol].format.includes('animated') && this[rawDataSymbol].scale.includes(scale)) {\n return this.getFormattedImageUrl(scale, 'animated', themeMode);\n }\n return null;\n }\n /**\n * Gets the URL of the emote image in the given scale, format, and theme mode.\n *\n * @param scale The scale of the image, either `1.0` (small), `2.0` (medium), or `3.0` (large).\n * @param format The format of the image, either `static` or `animated`.\n * @param themeMode The theme mode of the image, either `light` or `dark`.\n */\n getFormattedImageUrl(scale = '1.0', format = 'static', themeMode = 'light') {\n return `https://static-cdn.jtvnw.net/emoticons/v2/${this[rawDataSymbol].id}/${format}/${themeMode}/${scale}`;\n }\n}\n", "import { __decorate } from \"tslib\";\nimport { rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixEmoteBase } from './HelixEmoteBase.js';\n/**\n * A Twitch emote.\n */\nlet HelixEmote = class HelixEmote extends HelixEmoteBase {\n /**\n * Gets the URL of the emote image in the given scale.\n *\n * @param scale The scale of the image.\n */\n getImageUrl(scale) {\n return this[rawDataSymbol].images[`url_${scale}x`];\n }\n};\nHelixEmote = __decorate([\n rtfm('api', 'HelixEmote', 'id')\n], HelixEmote);\nexport { HelixEmote };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixEmote } from './HelixEmote.js';\n/**\n * A Twitch Channel emote.\n *\n * @inheritDoc\n */\nlet HelixChannelEmote = class HelixChannelEmote extends HelixEmote {\n /** @internal */ _client;\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The subscription tier necessary to unlock the emote, or null if the emote is not a subscription emote.\n */\n get tier() {\n return this[rawDataSymbol].tier || null;\n }\n /**\n * The type of the emote.\n *\n * There are many types of emotes that Twitch seems to arbitrarily assign. Do not rely on this value.\n */\n get type() {\n return this[rawDataSymbol].emote_type;\n }\n /**\n * The ID of the emote set the emote is part of.\n */\n get emoteSetId() {\n return this[rawDataSymbol].emote_set_id;\n }\n /**\n * Gets all emotes from the emote's set.\n */\n async getAllEmotesFromSet() {\n return await this._client.chat.getEmotesFromSets([this[rawDataSymbol].emote_set_id]);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixChannelEmote.prototype, \"_client\", void 0);\nHelixChannelEmote = __decorate([\n rtfm('api', 'HelixChannelEmote', 'id')\n], HelixChannelEmote);\nexport { HelixChannelEmote };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A version of a chat badge.\n */\nlet HelixChatBadgeVersion = class HelixChatBadgeVersion extends DataObject {\n /**\n * The badge version ID.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * Gets an image URL for the given scale.\n *\n * @param scale The scale of the badge image.\n */\n getImageUrl(scale) {\n return this[rawDataSymbol][`image_url_${scale}x`];\n }\n /**\n * The title of the badge.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The description of the badge.\n */\n get description() {\n return this[rawDataSymbol].description;\n }\n /**\n * The action to take when clicking on the badge. Set to `null` if no action is specified.\n */\n get clickAction() {\n return this[rawDataSymbol].click_action;\n }\n /**\n * The URL to navigate to when clicking on the badge. Set to `null` if no URL is specified.\n */\n get clickUrl() {\n return this[rawDataSymbol].click_url;\n }\n};\nHelixChatBadgeVersion = __decorate([\n rtfm('api', 'HelixChatBadgeVersion', 'id')\n], HelixChatBadgeVersion);\nexport { HelixChatBadgeVersion };\n", "import { __decorate } from \"tslib\";\nimport { Cacheable, CachedGetter } from '@d-fischer/cache-decorators';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixChatBadgeVersion } from './HelixChatBadgeVersion.js';\n/**\n * A version of a chat badge.\n */\nlet HelixChatBadgeSet = class HelixChatBadgeSet extends DataObject {\n /**\n * The badge set ID.\n */\n get id() {\n return this[rawDataSymbol].set_id;\n }\n /**\n * All versions of the badge.\n */\n get versions() {\n return this[rawDataSymbol].versions.map(data => new HelixChatBadgeVersion(data));\n }\n /**\n * Gets a specific version of the badge.\n *\n * @param versionId The ID of the version.\n */\n getVersion(versionId) {\n return this.versions.find(v => v.id === versionId) ?? null;\n }\n};\n__decorate([\n CachedGetter()\n], HelixChatBadgeSet.prototype, \"versions\", null);\nHelixChatBadgeSet = __decorate([\n Cacheable,\n rtfm('api', 'HelixChatBadgeSet', 'id')\n], HelixChatBadgeSet);\nexport { HelixChatBadgeSet };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A user connected to a Twitch channel's chat session.\n */\nlet HelixChatChatter = class HelixChatChatter extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the user.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets more information about the user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixChatChatter.prototype, \"_client\", void 0);\nHelixChatChatter = __decorate([\n rtfm('api', 'HelixChatChatter')\n], HelixChatChatter);\nexport { HelixChatChatter };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * The settings of a broadcaster's chat.\n */\nlet HelixChatSettings = class HelixChatSettings extends DataObject {\n /**\n * The ID of the broadcaster.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * Whether slow mode is enabled.\n */\n get slowModeEnabled() {\n return this[rawDataSymbol].slow_mode;\n }\n /**\n * The time to wait between messages in slow mode, in seconds.\n *\n * Is `null` if slow mode is not enabled.\n */\n get slowModeDelay() {\n return this[rawDataSymbol].slow_mode_wait_time;\n }\n /**\n * Whether follower only mode is enabled.\n */\n get followerOnlyModeEnabled() {\n return this[rawDataSymbol].follower_mode;\n }\n /**\n * The time after which users are able to send messages after following, in minutes.\n *\n * Is `null` if follower only mode is not enabled,\n * but may also be `0` if you can send messages immediately after following.\n */\n get followerOnlyModeDelay() {\n return this[rawDataSymbol].follower_mode_duration;\n }\n /**\n * Whether subscriber only mode is enabled.\n */\n get subscriberOnlyModeEnabled() {\n return this[rawDataSymbol].subscriber_mode;\n }\n /**\n * Whether emote only mode is enabled.\n */\n get emoteOnlyModeEnabled() {\n return this[rawDataSymbol].emote_mode;\n }\n /**\n * Whether unique chat mode is enabled.\n */\n get uniqueChatModeEnabled() {\n return this[rawDataSymbol].unique_chat_mode;\n }\n};\nHelixChatSettings = __decorate([\n rtfm('api', 'HelixChatSettings', 'broadcasterId')\n], HelixChatSettings);\nexport { HelixChatSettings };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixEmote } from './HelixEmote.js';\n/**\n * A Twitch Channel emote.\n *\n * @inheritDoc\n */\nlet HelixEmoteFromSet = class HelixEmoteFromSet extends HelixEmote {\n /** @internal */ _client;\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The type of the emote.\n *\n * Known values are: `subscriptions`, `bitstier`, `follower`, `rewards`, `globals`, `smilies`, `prime`, `limitedtime`.\n *\n * This list may be non-exhaustive.\n */\n get type() {\n return this[rawDataSymbol].emote_type;\n }\n /**\n * The ID of the emote set the emote is part of.\n */\n get emoteSetId() {\n return this[rawDataSymbol].emote_set_id;\n }\n /**\n * The ID of the user that owns the emote, or null if the emote is not owned by a user.\n */\n get ownerId() {\n switch (this[rawDataSymbol].owner_id) {\n case '0':\n case 'twitch': {\n return null;\n }\n default: {\n return this[rawDataSymbol].owner_id;\n }\n }\n }\n /**\n * Gets more information about the user that owns the emote, or null if the emote is not owned by a user.\n */\n async getOwner() {\n switch (this[rawDataSymbol].owner_id) {\n case '0':\n case 'twitch': {\n return null;\n }\n default: {\n return await this._client.users.getUserById(this[rawDataSymbol].owner_id);\n }\n }\n }\n};\n__decorate([\n Enumerable(false)\n], HelixEmoteFromSet.prototype, \"_client\", void 0);\nHelixEmoteFromSet = __decorate([\n rtfm('api', 'HelixEmoteFromSet', 'id')\n], HelixEmoteFromSet);\nexport { HelixEmoteFromSet };\n", "import { __decorate } from \"tslib\";\nimport { rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixChatSettings } from './HelixChatSettings.js';\n/**\n * The settings of a broadcaster's chat, with additional privileged data.\n */\nlet HelixPrivilegedChatSettings = class HelixPrivilegedChatSettings extends HelixChatSettings {\n /**\n * Whether non-moderator messages are delayed.\n */\n get nonModeratorChatDelayEnabled() {\n return this[rawDataSymbol].non_moderator_chat_delay;\n }\n /**\n * The delay of non-moderator messages, in seconds.\n *\n * Is `null` if non-moderator message delay is disabled.\n */\n get nonModeratorChatDelay() {\n return this[rawDataSymbol].non_moderator_chat_delay_duration;\n }\n};\nHelixPrivilegedChatSettings = __decorate([\n rtfm('api', 'HelixPrivilegedChatSettings', 'broadcasterId')\n], HelixPrivilegedChatSettings);\nexport { HelixPrivilegedChatSettings };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Information about a sent Twitch chat message.\n */\nlet HelixSentChatMessage = class HelixSentChatMessage extends DataObject {\n /**\n * The message ID of the sent message.\n */\n get id() {\n return this[rawDataSymbol].message_id;\n }\n /**\n * If the message passed all checks and was sent.\n */\n get isSent() {\n return this[rawDataSymbol].is_sent;\n }\n /**\n * The reason code for why the chat message was dropped, if dropped.\n */\n get dropReasonCode() {\n return this[rawDataSymbol].drop_reason?.code;\n }\n /**\n * The reason message for why the chat message was dropped, if dropped.\n */\n get dropReasonMessage() {\n return this[rawDataSymbol].drop_reason?.message;\n }\n};\nHelixSentChatMessage = __decorate([\n rtfm('api', 'HelixSentChatMessage', 'id')\n], HelixSentChatMessage);\nexport { HelixSentChatMessage };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A shared chat session participant.\n */\nlet HelixSharedChatSessionParticipant = class HelixSharedChatSessionParticipant extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the participant broadcaster.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * Gets information about the participant broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixSharedChatSessionParticipant.prototype, \"_client\", void 0);\nHelixSharedChatSessionParticipant = __decorate([\n rtfm('api', 'HelixSharedChatSessionParticipant', 'broadcasterId')\n], HelixSharedChatSessionParticipant);\nexport { HelixSharedChatSessionParticipant };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixSharedChatSessionParticipant } from './HelixSharedChatSessionParticipant.js';\n/**\n * A shared chat session.\n */\nlet HelixSharedChatSession = class HelixSharedChatSession extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The unique identifier for the shared chat session.\n */\n get sessionId() {\n return this[rawDataSymbol].session_id;\n }\n /**\n * The ID of the host broadcaster.\n */\n get hostBroadcasterId() {\n return this[rawDataSymbol].host_broadcaster_id;\n }\n /**\n * Gets information about the host broadcaster.\n */\n async getHostBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].host_broadcaster_id));\n }\n /**\n * The list of participants in the session.\n */\n get participants() {\n return this[rawDataSymbol].participants.map(data => new HelixSharedChatSessionParticipant(data, this._client));\n }\n /**\n * The date for when the session was created.\n */\n get createdDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The date for when the session was updated.\n */\n get updatedDate() {\n return new Date(this[rawDataSymbol].updated_at);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixSharedChatSession.prototype, \"_client\", void 0);\nHelixSharedChatSession = __decorate([\n rtfm('api', 'HelixSharedChatSession', 'sessionId')\n], HelixSharedChatSession);\nexport { HelixSharedChatSession };\n", "import { __decorate } from \"tslib\";\nimport { rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixEmoteBase } from './HelixEmoteBase.js';\nimport { Enumerable } from '@d-fischer/shared-utils';\n/**\n * A Twitch user emote.\n */\nlet HelixUserEmote = class HelixUserEmote extends HelixEmoteBase {\n /** @internal */ _client;\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The type of the emote.\n *\n * There are many types of emotes that Twitch seems to arbitrarily assign.\n * Check the relevant values in the official documentation.\n *\n * @see https://dev.twitch.tv/docs/api/reference/#get-user-emotes\n */\n get type() {\n return this[rawDataSymbol].emote_type;\n }\n /**\n * The ID that identifies the emote set that the emote belongs to, or `null` if the emote is not from any set.\n */\n get emoteSetId() {\n return this[rawDataSymbol].emote_set_id || null;\n }\n /**\n * The ID of the broadcaster who owns the emote, or `null` if the emote has no owner, e.g. it's a global emote.\n */\n get ownerId() {\n return this[rawDataSymbol].owner_id || null;\n }\n /**\n * Gets all emotes from the emotes set, or `null` if emote is not from any set.\n */\n async getAllEmotesFromSet() {\n return this[rawDataSymbol].emote_set_id\n ? await this._client.chat.getEmotesFromSets([this[rawDataSymbol].emote_set_id])\n : null;\n }\n /**\n * Gets more information about the user that owns the emote, or `null` if the emote is not owned by a user.\n */\n async getOwner() {\n return this[rawDataSymbol].owner_id ? await this._client.users.getUserById(this[rawDataSymbol].owner_id) : null;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixUserEmote.prototype, \"_client\", void 0);\nHelixUserEmote = __decorate([\n rtfm('api', 'HelixUserEmote', 'id')\n], HelixUserEmote);\nexport { HelixUserEmote };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { ChatMessageDroppedError } from '../../errors/ChatMessageDroppedError.js';\nimport { createChatColorUpdateQuery, createChatSettingsUpdateBody, createSendChatMessageAsAppBody, createSendChatMessageBody, createSendChatMessageQuery, createShoutoutQuery, } from '../../interfaces/endpoints/chat.external.js';\nimport { createModeratorActionQuery, createSingleKeyQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { createSharedChatSessionQuery, } from '../../interfaces/endpoints/shared-chat-session.external.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { HelixPaginatedRequestWithTotal } from '../../utils/pagination/HelixPaginatedRequestWithTotal.js';\nimport { createPaginatedResult, createPaginatedResultWithTotal, } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixChannelEmote } from './HelixChannelEmote.js';\nimport { HelixChatBadgeSet } from './HelixChatBadgeSet.js';\nimport { HelixChatChatter } from './HelixChatChatter.js';\nimport { HelixChatSettings } from './HelixChatSettings.js';\nimport { HelixEmote } from './HelixEmote.js';\nimport { HelixEmoteFromSet } from './HelixEmoteFromSet.js';\nimport { HelixPrivilegedChatSettings } from './HelixPrivilegedChatSettings.js';\nimport { HelixSentChatMessage } from './HelixSentChatMessage.js';\nimport { HelixSharedChatSession } from './HelixSharedChatSession.js';\nimport { HelixUserEmote } from './HelixUserEmote.js';\n/**\n * The Helix API methods that deal with chat.\n *\n * Can be accessed using `client.chat` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const rewards = await api.chat.getChannelBadges('125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Chat\n */\nlet HelixChatApi = class HelixChatApi extends BaseApi {\n /**\n * Gets the list of users that are connected to the broadcaster\u2019s chat session.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster whose list of chatters you want to get.\n * @param pagination\n *\n * @expandParams\n */\n async getChatters(broadcaster, pagination) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/chatters',\n userId: broadcasterId,\n canOverrideScopedUserContext: true,\n scopes: ['moderator:read:chatters'],\n query: {\n ...this._createModeratorActionQuery(broadcasterId),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResultWithTotal(result, HelixChatChatter, this._client);\n }\n /**\n * Creates a paginator for users that are connected to the broadcaster\u2019s chat session.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster whose list of chatters you want to get.\n *\n * @expandParams\n */\n getChattersPaginated(broadcaster) {\n const broadcasterId = extractUserId(broadcaster);\n return new HelixPaginatedRequestWithTotal({\n url: 'chat/chatters',\n userId: broadcasterId,\n canOverrideScopedUserContext: true,\n scopes: ['moderator:read:chatters'],\n query: this._createModeratorActionQuery(broadcasterId),\n }, this._client, data => new HelixChatChatter(data, this._client), 1000);\n }\n /**\n * Gets all global badges.\n */\n async getGlobalBadges() {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/badges/global',\n });\n return result.data.map(data => new HelixChatBadgeSet(data));\n }\n /**\n * Gets all badges specific to the given broadcaster.\n *\n * @param broadcaster The broadcaster to get badges for.\n */\n async getChannelBadges(broadcaster) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/badges',\n userId: extractUserId(broadcaster),\n query: createBroadcasterQuery(broadcaster),\n });\n return result.data.map(data => new HelixChatBadgeSet(data));\n }\n /**\n * Gets all global emotes.\n */\n async getGlobalEmotes() {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/emotes/global',\n });\n return result.data.map(data => new HelixEmote(data));\n }\n /**\n * Gets all emotes specific to the given broadcaster.\n *\n * @param broadcaster The broadcaster to get emotes for.\n */\n async getChannelEmotes(broadcaster) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/emotes',\n userId: extractUserId(broadcaster),\n query: createBroadcasterQuery(broadcaster),\n });\n return result.data.map(data => new HelixChannelEmote(data, this._client));\n }\n /**\n * Gets all emotes from a list of emote sets.\n *\n * @param setIds The IDs of the emote sets to get emotes from.\n */\n async getEmotesFromSets(setIds) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/emotes/set',\n query: createSingleKeyQuery('emote_set_id', setIds),\n });\n return result.data.map(data => new HelixEmoteFromSet(data, this._client));\n }\n /**\n * Gets emotes available to the user across all channels.\n *\n * @param user The ID of the user to get available emotes of.\n * @param filter Additional query filters.\n */\n async getUserEmotes(user, filter) {\n const userId = extractUserId(user);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/emotes/user',\n userId: extractUserId(user),\n scopes: ['user:read:emotes'],\n query: {\n ...createSingleKeyQuery('user_id', userId),\n ...createSingleKeyQuery('broadcasterId', filter?.broadcaster ? extractUserId(filter.broadcaster) : undefined),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixUserEmote, this._client);\n }\n /**\n * Creates a paginator for emotes available to the user across all channels.\n *\n * @param user The ID of the user to get available emotes of.\n * @param broadcaster The ID of a broadcaster you wish to get follower emotes of. Using this query parameter will\n * guarantee inclusion of the broadcaster\u2019s follower emotes in the response body.\n *\n * If the user who retrieves their emotes is subscribed to the broadcaster specified, their follower emotes will\n * appear in the response body regardless of whether this query parameter is used.\n */\n getUserEmotesPaginated(user, broadcaster) {\n const userId = extractUserId(user);\n return new HelixPaginatedRequest({\n url: 'chat/emotes/user',\n userId,\n scopes: ['user:read:emotes'],\n query: {\n ...createSingleKeyQuery('user_id', userId),\n ...createSingleKeyQuery('broadcasterId', broadcaster ? extractUserId(broadcaster) : undefined),\n },\n }, this._client, (data) => new HelixUserEmote(data, this._client));\n }\n /**\n * Gets the settings of a broadcaster's chat.\n *\n * @param broadcaster The broadcaster the chat belongs to.\n */\n async getSettings(broadcaster) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/settings',\n userId: extractUserId(broadcaster),\n query: createBroadcasterQuery(broadcaster),\n });\n return new HelixChatSettings(result.data[0]);\n }\n /**\n * Gets the settings of a broadcaster's chat, including the delay settings.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster the chat belongs to.\n */\n async getSettingsPrivileged(broadcaster) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/settings',\n userId: broadcasterId,\n canOverrideScopedUserContext: true,\n scopes: ['moderator:read:chat_settings'],\n query: this._createModeratorActionQuery(broadcasterId),\n });\n return new HelixPrivilegedChatSettings(result.data[0]);\n }\n /**\n * Updates the settings of a broadcaster's chat.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @expandParams\n *\n * @param broadcaster The broadcaster the chat belongs to.\n * @param settings The settings to change.\n */\n async updateSettings(broadcaster, settings) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/settings',\n method: 'PATCH',\n userId: broadcasterId,\n canOverrideScopedUserContext: true,\n scopes: ['moderator:manage:chat_settings'],\n query: this._createModeratorActionQuery(broadcasterId),\n jsonBody: createChatSettingsUpdateBody(settings),\n });\n return new HelixPrivilegedChatSettings(result.data[0]);\n }\n /**\n * Sends a chat message to a broadcaster's chat.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @expandParams\n *\n * @param broadcaster The broadcaster the chat belongs to.\n * @param message The message to send.\n * @param params\n */\n async sendChatMessage(broadcaster, message, params) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/messages',\n method: 'POST',\n userId: broadcasterId,\n canOverrideScopedUserContext: true,\n scopes: ['user:write:chat'],\n query: createSendChatMessageQuery(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)),\n jsonBody: createSendChatMessageBody(message, params),\n });\n const msg = new HelixSentChatMessage(result.data[0]);\n this._handleUnsentChatMessage(broadcasterId, msg);\n return msg;\n }\n /**\n * Sends a chat message to a broadcaster's chat, using an app token.\n *\n * This requires the scopes `user:write:chat` and `user:bot` for the `user` and `channel:bot` for the `broadcaster`.\n * `channel:bot` is not required if the `user` has moderator privileges in the `broadcaster`'s channel.\n *\n * These scope requirements can not be checked by the library, so they are just assumed.\n * Make sure to catch authorization errors yourself.\n *\n * @expandParams\n *\n * @param user The user to send the chat message from.\n * @param broadcaster The broadcaster the chat belongs to.\n * @param message The message to send.\n * @param params\n */\n async sendChatMessageAsApp(user, broadcaster, message, params) {\n const userId = extractUserId(user);\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'chat/messages',\n method: 'POST',\n forceType: 'app',\n query: createSendChatMessageQuery(broadcasterId, userId),\n jsonBody: createSendChatMessageAsAppBody(message, params),\n });\n const msg = new HelixSentChatMessage(result.data[0]);\n this._handleUnsentChatMessage(broadcasterId, msg);\n return msg;\n }\n /**\n * Sends an announcement to a broadcaster's chat.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster the chat belongs to.\n * @param announcement The announcement to send.\n */\n async sendAnnouncement(broadcaster, announcement) {\n const broadcasterId = extractUserId(broadcaster);\n await this._client.callApi({\n type: 'helix',\n url: 'chat/announcements',\n method: 'POST',\n userId: broadcasterId,\n canOverrideScopedUserContext: true,\n scopes: ['moderator:manage:announcements'],\n query: this._createModeratorActionQuery(broadcasterId),\n jsonBody: {\n message: announcement.message,\n color: announcement.color,\n },\n });\n }\n /**\n * Gets the chat colors for a list of users.\n *\n * Returns a Map with user IDs as keys and their colors as values.\n * The value is a color hex code, or `null` if the user did not set a color,\n * and unknown users will not be present in the map.\n *\n * @param users The users to get the chat colors of.\n */\n async getColorsForUsers(users) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'chat/color',\n query: createSingleKeyQuery('user_id', users.map(extractUserId)),\n });\n return new Map(response.data.map(data => [data.user_id, data.color || null]));\n }\n /**\n * Gets the chat color for a user.\n *\n * Returns the color as hex code, `null` if the user did not set a color, or `undefined` if the user is unknown.\n *\n * @param user The user to get the chat color of.\n */\n async getColorForUser(user) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'chat/color',\n userId: extractUserId(user),\n query: createSingleKeyQuery('user_id', extractUserId(user)),\n });\n if (!response.data.length) {\n return undefined;\n }\n return response.data[0].color || null;\n }\n /**\n * Changes the chat color for a user.\n *\n * @param user The user to change the color of.\n * @param color The color to set.\n *\n * Note that hex codes can only be used by users that have a Prime or Turbo subscription.\n */\n async setColorForUser(user, color) {\n await this._client.callApi({\n type: 'helix',\n url: 'chat/color',\n method: 'PUT',\n userId: extractUserId(user),\n scopes: ['user:manage:chat_color'],\n query: createChatColorUpdateQuery(user, color),\n });\n }\n /**\n * Sends a shoutout to the specified broadcaster.\n * The broadcaster may send a shoutout once every 2 minutes. They may send the same broadcaster a shoutout once every 60 minutes.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param from The ID of the broadcaster that\u2019s sending the shoutout.\n * @param to The ID of the broadcaster that\u2019s receiving the shoutout.\n */\n async shoutoutUser(from, to) {\n const fromId = extractUserId(from);\n await this._client.callApi({\n type: 'helix',\n url: 'chat/shoutouts',\n method: 'POST',\n userId: fromId,\n canOverrideScopedUserContext: true,\n scopes: ['moderator:manage:shoutouts'],\n query: createShoutoutQuery(from, to, this._getUserContextIdWithDefault(fromId)),\n });\n }\n /**\n * Gets the active shared chat session for a channel.\n *\n * Returns `null` if there is no active shared chat session in the channel.\n *\n * @param broadcaster The broadcaster to get the active shared chat session for.\n */\n async getSharedChatSession(broadcaster) {\n const broadcasterId = extractUserId(broadcaster);\n const response = await this._client.callApi({\n type: 'helix',\n url: 'shared_chat/session',\n userId: broadcasterId,\n query: createSharedChatSessionQuery(broadcasterId),\n });\n if (response.data.length === 0) {\n return null;\n }\n return new HelixSharedChatSession(response.data[0], this._client);\n }\n _createModeratorActionQuery(broadcasterId) {\n return createModeratorActionQuery(broadcasterId, this._getUserContextIdWithDefault(broadcasterId));\n }\n _handleUnsentChatMessage(broadcasterId, msg) {\n if (!msg.isSent) {\n throw new ChatMessageDroppedError(broadcasterId, msg.dropReasonMessage, msg.dropReasonCode);\n }\n }\n};\nHelixChatApi = __decorate([\n rtfm('api', 'HelixChatApi')\n], HelixChatApi);\nexport { HelixChatApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createClipCreateQuery(params) {\n const { channel, createAfterDelay = false, title, duration } = params;\n return {\n broadcaster_id: extractUserId(channel),\n has_delay: createAfterDelay.toString(),\n title,\n duration: duration?.toFixed(1),\n };\n}\n/** @internal */\nexport function createClipCreateFromVodQuery(params, editorId) {\n const { channel, title, duration, vodId, vodOffset } = params;\n return {\n broadcaster_id: extractUserId(channel),\n editor_id: editorId,\n title,\n duration: duration?.toFixed(1),\n vod_id: vodId,\n vod_offset: vodOffset.toString(),\n };\n}\n/** @internal */\nexport function createClipQuery(params) {\n const { filterType, ids, startDate, endDate, isFeatured } = params;\n return {\n [filterType]: ids,\n started_at: startDate,\n ended_at: endDate,\n is_featured: isFeatured?.toString(),\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A clip from a Twitch stream.\n */\nlet HelixClip = class HelixClip extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The clip ID.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The URL of the clip.\n */\n get url() {\n return this[rawDataSymbol].url;\n }\n /**\n * The embed URL of the clip.\n */\n get embedUrl() {\n return this[rawDataSymbol].embed_url;\n }\n /**\n * The user ID of the broadcaster of the stream where the clip was created.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The display name of the broadcaster of the stream where the clip was created.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets information about the broadcaster of the stream where the clip was created.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The user ID of the creator of the clip.\n */\n get creatorId() {\n return this[rawDataSymbol].creator_id;\n }\n /**\n * The display name of the creator of the clip.\n */\n get creatorDisplayName() {\n return this[rawDataSymbol].creator_name;\n }\n /**\n * Gets information about the creator of the clip.\n */\n async getCreator() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].creator_id));\n }\n /**\n * The ID of the video the clip is taken from.\n */\n get videoId() {\n return this[rawDataSymbol].video_id;\n }\n /**\n * Gets information about the video the clip is taken from.\n */\n async getVideo() {\n return checkRelationAssertion(await this._client.videos.getVideoById(this[rawDataSymbol].video_id));\n }\n /**\n * The ID of the game that was being played when the clip was created.\n */\n get gameId() {\n return this[rawDataSymbol].game_id;\n }\n /**\n * Gets information about the game that was being played when the clip was created.\n */\n async getGame() {\n return this[rawDataSymbol].game_id\n ? checkRelationAssertion(await this._client.games.getGameById(this[rawDataSymbol].game_id))\n : null;\n }\n /**\n * The language of the stream where the clip was created.\n */\n get language() {\n return this[rawDataSymbol].language;\n }\n /**\n * The title of the clip.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The number of views of the clip.\n */\n get views() {\n return this[rawDataSymbol].view_count;\n }\n /**\n * The date when the clip was created.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The URL of the thumbnail of the clip.\n */\n get thumbnailUrl() {\n return this[rawDataSymbol].thumbnail_url;\n }\n /**\n * The duration of the clip in seconds (up to 0.1 precision).\n */\n get duration() {\n return this[rawDataSymbol].duration;\n }\n /**\n * The offset of the clip from the start of the corresponding VOD, in seconds.\n *\n * This may be null if there is no VOD or if the clip is created from a live broadcast,\n * in which case it may take a few minutes to associate with the VOD.\n */\n get vodOffset() {\n return this[rawDataSymbol].vod_offset;\n }\n /**\n * Whether the clip is featured.\n */\n get isFeatured() {\n return this[rawDataSymbol].is_featured;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixClip.prototype, \"_client\", void 0);\nHelixClip = __decorate([\n rtfm('api', 'HelixClip', 'id')\n], HelixClip);\nexport { HelixClip };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createClipCreateFromVodQuery, createClipCreateQuery, createClipQuery, } from '../../interfaces/endpoints/clip.external.js';\nimport { HelixRequestBatcher } from '../../utils/HelixRequestBatcher.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixClip } from './HelixClip.js';\n/**\n * The Helix API methods that deal with clips.\n *\n * Can be accessed using `client.clips` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const clipId = await api.clips.createClip({ channel: '125328655' });\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Clips\n */\nlet HelixClipApi = class HelixClipApi extends BaseApi {\n /** @internal */\n _getClipByIdBatcher = new HelixRequestBatcher({\n url: 'clips',\n }, 'id', 'id', this._client, (data) => new HelixClip(data, this._client));\n /**\n * Gets clips for the specified broadcaster in descending order of views.\n *\n * @param broadcaster The broadcaster to fetch clips for.\n * @param filter\n *\n * @expandParams\n */\n async getClipsForBroadcaster(broadcaster, filter = {}) {\n return await this._getClips({\n ...filter,\n filterType: 'broadcaster_id',\n ids: extractUserId(broadcaster),\n userId: extractUserId(broadcaster),\n });\n }\n /**\n * Creates a paginator for clips for the specified broadcaster.\n *\n * @param broadcaster The broadcaster to fetch clips for.\n * @param filter\n *\n * @expandParams\n */\n getClipsForBroadcasterPaginated(broadcaster, filter = {}) {\n return this._getClipsPaginated({\n ...filter,\n filterType: 'broadcaster_id',\n ids: extractUserId(broadcaster),\n userId: extractUserId(broadcaster),\n });\n }\n /**\n * Gets clips for the specified game in descending order of views.\n *\n * @param gameId The game ID.\n * @param filter\n *\n * @expandParams\n */\n async getClipsForGame(gameId, filter = {}) {\n return await this._getClips({\n ...filter,\n filterType: 'game_id',\n ids: gameId,\n });\n }\n /**\n * Creates a paginator for clips for the specified game.\n *\n * @param gameId The game ID.\n * @param filter\n *\n * @expandParams\n */\n getClipsForGamePaginated(gameId, filter = {}) {\n return this._getClipsPaginated({\n ...filter,\n filterType: 'game_id',\n ids: gameId,\n });\n }\n /**\n * Gets the clips identified by the given IDs.\n *\n * @param ids The clip IDs.\n */\n async getClipsByIds(ids) {\n const result = await this._getClips({\n filterType: 'id',\n ids,\n });\n return result.data;\n }\n /**\n * Gets the clip identified by the given ID.\n *\n * @param id The clip ID.\n */\n async getClipById(id) {\n const clips = await this.getClipsByIds([id]);\n return clips.length ? clips[0] : null;\n }\n /**\n * Gets the clip identified by the given ID, batching multiple calls into fewer requests as the API allows.\n *\n * @param id The clip ID.\n */\n async getClipByIdBatched(id) {\n return await this._getClipByIdBatcher.request(id);\n }\n /**\n * Creates a clip of a running stream.\n *\n * Returns the ID of the clip.\n *\n * @param params\n * @expandParams\n */\n async createClip(params) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'clips',\n method: 'POST',\n userId: extractUserId(params.channel),\n scopes: ['clips:edit'],\n canOverrideScopedUserContext: true,\n query: createClipCreateQuery(params),\n });\n return result.data[0].id;\n }\n /**\n * Creates a clip of a VOD.\n *\n * Returns the ID of the clip.\n *\n * @param params\n * @expandParams\n */\n async createClipFromVod(params) {\n const broadcasterId = extractUserId(params.channel);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'videos/clips',\n method: 'POST',\n userId: broadcasterId,\n scopes: ['editor:manage:clips', 'channel:manage:clips'],\n canOverrideScopedUserContext: true,\n query: createClipCreateFromVodQuery(params, this._getUserContextIdWithDefault(broadcasterId)),\n });\n return result.data[0].id;\n }\n async _getClips(params) {\n if (!params.ids.length) {\n return { data: [] };\n }\n const result = await this._client.callApi({\n type: 'helix',\n url: 'clips',\n userId: params.userId,\n query: {\n ...createClipQuery(params),\n ...createPaginationQuery(params),\n },\n });\n return createPaginatedResult(result, HelixClip, this._client);\n }\n _getClipsPaginated(params) {\n return new HelixPaginatedRequest({\n url: 'clips',\n userId: params.userId,\n query: createClipQuery(params),\n }, this._client, data => new HelixClip(data, this._client));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixClipApi.prototype, \"_getClipByIdBatcher\", void 0);\nHelixClipApi = __decorate([\n rtfm('api', 'HelixClipApi')\n], HelixClipApi);\nexport { HelixClipApi };\n", "import { DataObject, rawDataSymbol } from '@twurple/common';\n/**\n * A content classification label that can be applied to a Twitch stream.\n */\nexport class HelixContentClassificationLabel extends DataObject {\n /**\n * The ID of the content classification label.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The name of the content classification label.\n */\n get name() {\n return this[rawDataSymbol].name;\n }\n /**\n * The description of the content classification label.\n */\n get description() {\n return this[rawDataSymbol].description;\n }\n}\n", "import { __decorate } from \"tslib\";\nimport { rtfm } from '@twurple/common';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixContentClassificationLabel } from './HelixContentClassificationLabel.js';\n/**\n * The Helix API methods that deal with content classification labels.\n *\n * Can be accessed using `client.contentClassificationLabels` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const labels = await api.contentClassificationLabels.getAll();\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Content classification labels\n */\nlet HelixContentClassificationLabelApi = class HelixContentClassificationLabelApi extends BaseApi {\n /**\n * Fetches a list of all content classification labels.\n *\n * @param locale The locale for the content classification labels.\n */\n async getAll(locale) {\n const result = await this._client.callApi({\n url: 'content_classification_labels',\n query: {\n locale,\n },\n });\n return result.data.map(data => new HelixContentClassificationLabel(data));\n }\n};\nHelixContentClassificationLabelApi = __decorate([\n rtfm('api', 'HelixContentClassificationLabelApi')\n], HelixContentClassificationLabelApi);\nexport { HelixContentClassificationLabelApi };\n", "import { mapOptional } from '@d-fischer/shared-utils';\nimport { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createDropsEntitlementQuery(filters, alwaysApp) {\n return {\n user_id: alwaysApp ? mapOptional(filters.user, extractUserId) : undefined,\n game_id: filters.gameId,\n fulfillment_status: filters.fulfillmentStatus,\n };\n}\n/** @internal */\nexport function createDropsEntitlementUpdateBody(ids, fulfillmentStatus) {\n return {\n fulfillment_status: fulfillmentStatus,\n entitlement_ids: ids,\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * An entitlement for a drop.\n */\nlet HelixDropsEntitlement = class HelixDropsEntitlement extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the entitlement.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the reward.\n */\n get rewardId() {\n return this[rawDataSymbol].benefit_id;\n }\n /**\n * The date when the entitlement was granted.\n */\n get grantDate() {\n return new Date(this[rawDataSymbol].timestamp);\n }\n /**\n * The ID of the entitled user.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * Gets more information about the entitled user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * The ID of the game the entitlement was granted for.\n */\n get gameId() {\n return this[rawDataSymbol].game_id;\n }\n /**\n * Gets more information about the game the entitlement was granted for.\n */\n async getGame() {\n return checkRelationAssertion(await this._client.games.getGameById(this[rawDataSymbol].game_id));\n }\n /**\n * The fulfillment status of the entitlement.\n */\n get fulfillmentStatus() {\n return this[rawDataSymbol].fulfillment_status;\n }\n /**\n * The date when the entitlement was last updated.\n */\n get updateDate() {\n return new Date(this[rawDataSymbol].last_updated);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixDropsEntitlement.prototype, \"_client\", void 0);\nHelixDropsEntitlement = __decorate([\n rtfm('api', 'HelixDropsEntitlement')\n], HelixDropsEntitlement);\nexport { HelixDropsEntitlement };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable, mapOptional } from '@d-fischer/shared-utils';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createDropsEntitlementQuery, createDropsEntitlementUpdateBody, } from '../../interfaces/endpoints/entitlement.external.js';\nimport { HelixRequestBatcher } from '../../utils/HelixRequestBatcher.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixDropsEntitlement } from './HelixDropsEntitlement.js';\n/**\n * The Helix API methods that deal with entitlements (drops).\n *\n * Can be accessed using `client.entitlements` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const clipId = await api.entitlements.getDropsEntitlements();\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Entitlements (Drops)\n */\nlet HelixEntitlementApi = class HelixEntitlementApi extends BaseApi {\n /** @internal */ _getDropsEntitlementByIdBatcher = new HelixRequestBatcher({\n url: 'entitlements/drops',\n }, 'id', 'id', this._client, (data) => new HelixDropsEntitlement(data, this._client));\n /**\n * Gets the drops entitlements for the given filter.\n *\n * @expandParams\n *\n * @param filter\n * @param alwaysApp Whether an app token should always be used, even if a user filter is given.\n */\n async getDropsEntitlements(filter, alwaysApp = false) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'entitlements/drops',\n userId: mapOptional(filter.user, extractUserId),\n forceType: filter.user && alwaysApp ? 'app' : undefined,\n query: {\n ...createDropsEntitlementQuery(filter, alwaysApp),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(response, HelixDropsEntitlement, this._client);\n }\n /**\n * Creates a paginator for drops entitlements for the given filter.\n *\n * @expandParams\n *\n * @param filter\n * @param alwaysApp Whether an app token should always be used, even if a user filter is given.\n */\n getDropsEntitlementsPaginated(filter, alwaysApp = false) {\n return new HelixPaginatedRequest({\n url: 'entitlements/drops',\n userId: mapOptional(filter.user, extractUserId),\n forceType: filter.user && alwaysApp ? 'app' : undefined,\n query: createDropsEntitlementQuery(filter, alwaysApp),\n }, this._client, data => new HelixDropsEntitlement(data, this._client));\n }\n /**\n * Gets the drops entitlements for the given IDs.\n *\n * @param ids The IDs to fetch.\n */\n async getDropsEntitlementsByIds(ids) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'entitlements/drops',\n query: {\n id: ids,\n },\n });\n return response.data.map(data => new HelixDropsEntitlement(data, this._client));\n }\n /**\n * Gets the drops entitlement for the given ID.\n *\n * @param id The ID to fetch.\n */\n async getDropsEntitlementById(id) {\n const result = await this.getDropsEntitlementsByIds([id]);\n return result[0] ?? null;\n }\n /**\n * Gets the drops entitlement for the given ID, batching multiple calls into fewer requests as the API allows.\n *\n * @param id The ID to fetch.\n */\n async getDropsEntitlementByIdBatched(id) {\n return await this._getDropsEntitlementByIdBatcher.request(id);\n }\n /**\n * Updates the status of a list of drops entitlements.\n *\n * Returns a map that associates each given ID with its update status.\n *\n * @param ids The IDs of the entitlements.\n * @param fulfillmentStatus The fulfillment status to set the entitlements to.\n */\n async updateDropsEntitlements(ids, fulfillmentStatus) {\n const response = await this._client.callApi({\n type: 'helix',\n url: 'entitlements/drops',\n method: 'PATCH',\n jsonBody: createDropsEntitlementUpdateBody(ids, fulfillmentStatus),\n });\n return new Map(response.data.flatMap(entry => entry.ids.map(id => [id, entry.status])));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixEntitlementApi.prototype, \"_getDropsEntitlementByIdBatcher\", void 0);\nHelixEntitlementApi = __decorate([\n rtfm('api', 'HelixEntitlementApi')\n], HelixEntitlementApi);\nexport { HelixEntitlementApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createEventSubBroadcasterCondition(broadcaster) {\n return {\n broadcaster_user_id: extractUserId(broadcaster),\n };\n}\n/** @internal */\nexport function createEventSubRewardCondition(broadcaster, rewardId) {\n return { broadcaster_user_id: extractUserId(broadcaster), reward_id: rewardId };\n}\n/** @internal */\nexport function createEventSubModeratorCondition(broadcasterId, moderatorId) {\n return {\n broadcaster_user_id: broadcasterId,\n moderator_user_id: moderatorId,\n };\n}\n/** @internal */\nexport function createEventSubUserCondition(broadcasterId, userId) {\n return {\n broadcaster_user_id: broadcasterId,\n user_id: userId,\n };\n}\n/** @internal */\nexport function createEventSubDropEntitlementGrantCondition(filter) {\n return {\n organization_id: filter.organizationId,\n category_id: filter.categoryId,\n campaign_id: filter.campaignId,\n };\n}\n/** @internal */\nexport function createEventSubConduitCondition(conduitId, status) {\n return {\n conduit_id: conduitId,\n status,\n };\n}\n/** @internal */\nexport function createEventSubConduitUpdateCondition(conduitId, shardCount) {\n return {\n id: conduitId,\n shard_count: shardCount.toString(),\n };\n}\n/** @internal */\nexport function createEventSubConduitShardsUpdateCondition(conduitId, shards) {\n return {\n conduit_id: conduitId,\n shards,\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * An EventSub subscription.\n */\nlet HelixEventSubSubscription = class HelixEventSubSubscription extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the subscription.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The status of the subscription.\n */\n get status() {\n return this[rawDataSymbol].status;\n }\n /**\n * The event type that the subscription is listening to.\n */\n get type() {\n return this[rawDataSymbol].type;\n }\n /**\n * The cost of the subscription.\n */\n get cost() {\n return this[rawDataSymbol].cost;\n }\n /**\n * The condition of the subscription.\n */\n get condition() {\n return this[rawDataSymbol].condition;\n }\n /**\n * The date and time of creation of the subscription.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The transport method of the subscription.\n */\n get transportMethod() {\n return this[rawDataSymbol].transport.method;\n }\n /**\n * End the EventSub subscription.\n */\n async unsubscribe() {\n await this._client.eventSub.deleteSubscription(this[rawDataSymbol].id);\n }\n /** @private */\n get _transport() {\n return this[rawDataSymbol].transport;\n }\n /** @private */\n set _status(status) {\n this[rawDataSymbol].status = status;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixEventSubSubscription.prototype, \"_client\", void 0);\nHelixEventSubSubscription = __decorate([\n rtfm('api', 'HelixEventSubSubscription', 'id')\n], HelixEventSubSubscription);\nexport { HelixEventSubSubscription };\n", "import { __decorate } from \"tslib\";\nimport { rtfm } from '@twurple/common';\nimport { HelixPaginatedRequestWithTotal } from '../../utils/pagination/HelixPaginatedRequestWithTotal.js';\nimport { HelixEventSubSubscription } from './HelixEventSubSubscription.js';\n/**\n * A special case of {@link HelixPaginatedRequestWithTotal} with support for fetching the total cost and cost limit\n * of EventSub subscriptions.\n *\n * @inheritDoc\n */\nlet HelixPaginatedEventSubSubscriptionsRequest = class HelixPaginatedEventSubSubscriptionsRequest extends HelixPaginatedRequestWithTotal {\n /** @internal */\n constructor(query, userId, client) {\n super({\n url: 'eventsub/subscriptions',\n userId,\n query,\n }, client, data => new HelixEventSubSubscription(data, client));\n }\n /**\n * Gets the total cost of EventSub subscriptions.\n */\n async getTotalCost() {\n const data = this._currentData ??\n (await this._fetchData({ query: { after: undefined } }));\n return data.total_cost;\n }\n /**\n * Gets the cost limit of EventSub subscriptions.\n */\n async getMaxTotalCost() {\n const data = this._currentData ??\n (await this._fetchData({ query: { after: undefined } }));\n return data.max_total_cost;\n }\n};\nHelixPaginatedEventSubSubscriptionsRequest = __decorate([\n rtfm('api', 'HelixPaginatedEventSubSubscriptionsRequest')\n], HelixPaginatedEventSubSubscriptionsRequest);\nexport { HelixPaginatedEventSubSubscriptionsRequest };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Represents an EventSub conduit.\n */\nlet HelixEventSubConduit = class HelixEventSubConduit extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the conduit.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The shard count of the conduit.\n */\n get shardCount() {\n return this[rawDataSymbol].shard_count;\n }\n /**\n * Update the conduit.\n *\n * @param shardCount The new shard count.\n */\n async update(shardCount) {\n return await this._client.eventSub.updateConduit(this[rawDataSymbol].id, shardCount);\n }\n /**\n * Delete the conduit.\n */\n async delete() {\n await this._client.eventSub.deleteConduit(this[rawDataSymbol].id);\n }\n /**\n * Get the conduit shards.\n */\n async getShards() {\n return await this._client.eventSub.getConduitShards(this[rawDataSymbol].id);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixEventSubConduit.prototype, \"_client\", void 0);\nHelixEventSubConduit = __decorate([\n rtfm('api', 'HelixEventSubConduit')\n], HelixEventSubConduit);\nexport { HelixEventSubConduit };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Represents an EventSub conduit shard.\n */\nlet HelixEventSubConduitShard = class HelixEventSubConduitShard extends DataObject {\n /**\n * The ID of the shard.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The status of the shard.\n */\n get status() {\n return this[rawDataSymbol].status;\n }\n /**\n * The transport method of the shard.\n */\n get transportMethod() {\n return this[rawDataSymbol].transport.method;\n }\n};\nHelixEventSubConduitShard = __decorate([\n rtfm('api', 'HelixEventSubConduitShard')\n], HelixEventSubConduitShard);\nexport { HelixEventSubConduitShard };\n", "import { __decorate } from \"tslib\";\nimport { mapOptional } from '@d-fischer/shared-utils';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createEventSubBroadcasterCondition, createEventSubDropEntitlementGrantCondition, createEventSubModeratorCondition, createEventSubRewardCondition, createEventSubUserCondition, createEventSubConduitCondition, createEventSubConduitUpdateCondition, createEventSubConduitShardsUpdateCondition, } from '../../interfaces/endpoints/eventSub.external.js';\nimport { createSingleKeyQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResultWithTotal, createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixEventSubSubscription } from './HelixEventSubSubscription.js';\nimport { HelixPaginatedEventSubSubscriptionsRequest } from './HelixPaginatedEventSubSubscriptionsRequest.js';\nimport { HelixEventSubConduit } from './HelixEventSubConduit.js';\nimport { HelixEventSubConduitShard } from './HelixEventSubConduitShard.js';\n/**\n * The API methods that deal with EventSub.\n *\n * Can be accessed using `client.eventSub` on an {@link ApiClient} instance.\n *\n * ## Before using these methods...\n *\n * All methods in this class assume that you are already running a working EventSub listener reachable using the given transport.\n *\n * If you don't already have one, we recommend use of the `@twurple/eventsub-http` or `@twurple/eventsub-ws` libraries,\n * which handle subscribing and unsubscribing to these topics automatically.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * await api.eventSub.subscribeToUserFollowsTo('125328655', { callbackUrl: 'https://example.com' });\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle EventSub\n */\nlet HelixEventSubApi = class HelixEventSubApi extends BaseApi {\n /**\n * Gets the current EventSub subscriptions for the current client.\n *\n * @param pagination\n *\n * @expandParams\n */\n async getSubscriptions(pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/subscriptions',\n query: createPaginationQuery(pagination),\n });\n return {\n ...createPaginatedResultWithTotal(result, HelixEventSubSubscription, this._client),\n totalCost: result.total_cost,\n maxTotalCost: result.max_total_cost,\n };\n }\n /**\n * Creates a paginator for the current EventSub subscriptions for the current client.\n */\n getSubscriptionsPaginated() {\n return new HelixPaginatedEventSubSubscriptionsRequest({}, undefined, this._client);\n }\n /**\n * Gets the current EventSub subscriptions with the given status for the current client.\n *\n * @param status The status of the subscriptions to get.\n * @param pagination\n *\n * @expandParams\n */\n async getSubscriptionsForStatus(status, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/subscriptions',\n query: {\n ...createPaginationQuery(pagination),\n status,\n },\n });\n return {\n ...createPaginatedResultWithTotal(result, HelixEventSubSubscription, this._client),\n totalCost: result.total_cost,\n maxTotalCost: result.max_total_cost,\n };\n }\n /**\n * Creates a paginator for the current EventSub subscriptions with the given status for the current client.\n *\n * @param status The status of the subscriptions to get.\n */\n getSubscriptionsForStatusPaginated(status) {\n return new HelixPaginatedEventSubSubscriptionsRequest({ status }, undefined, this._client);\n }\n /**\n * Gets the current EventSub subscriptions with the given type for the current client.\n *\n * @param type The type of the subscriptions to get.\n * @param pagination\n *\n * @expandParams\n */\n async getSubscriptionsForType(type, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/subscriptions',\n query: {\n ...createPaginationQuery(pagination),\n type,\n },\n });\n return {\n ...createPaginatedResultWithTotal(result, HelixEventSubSubscription, this._client),\n totalCost: result.total_cost,\n maxTotalCost: result.max_total_cost,\n };\n }\n /**\n * Creates a paginator for the current EventSub subscriptions with the given type for the current client.\n *\n * @param type The type of the subscriptions to get.\n */\n getSubscriptionsForTypePaginated(type) {\n return new HelixPaginatedEventSubSubscriptionsRequest({ type }, undefined, this._client);\n }\n /**\n * Gets the current EventSub subscriptions for the current user and client.\n *\n * @param user The user to get subscriptions for.\n * @param pagination\n *\n * @expandParams\n */\n async getSubscriptionsForUser(user, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/subscriptions',\n userId: extractUserId(user),\n query: {\n ...createSingleKeyQuery('user_id', extractUserId(user)),\n ...createPaginationQuery(pagination),\n },\n });\n return {\n ...createPaginatedResultWithTotal(result, HelixEventSubSubscription, this._client),\n totalCost: result.total_cost,\n maxTotalCost: result.max_total_cost,\n };\n }\n /**\n * Creates a paginator for the current EventSub subscriptions with the given type for the current client.\n *\n * @param user The user to get subscriptions for.\n */\n getSubscriptionsForUserPaginated(user) {\n const userId = extractUserId(user);\n return new HelixPaginatedEventSubSubscriptionsRequest(createSingleKeyQuery('user_id', userId), userId, this._client);\n }\n /**\n * Sends an arbitrary request to subscribe to an event.\n *\n * You can only create WebHook transport subscriptions using app tokens\n * and WebSocket transport subscriptions using user tokens.\n *\n * @param type The type of the event.\n * @param version The version of the event.\n * @param condition The condition of the subscription.\n * @param transport The transport of the subscription.\n * @param user The user to create the subscription in context of.\n * @param requiredScopeSet The scope set required by the subscription. Will only be checked for applicable transports.\n * @param canOverrideScopedUserContext Whether the auth user context can be overridden.\n * @param isBatched Whether to enable batching for the subscription. Is only supported for select topics.\n */\n async createSubscription(type, version, condition, transport, user, requiredScopeSet, canOverrideScopedUserContext, isBatched) {\n const usesAppAuth = transport.method === 'webhook' || transport.method === 'conduit';\n const scopes = usesAppAuth ? undefined : requiredScopeSet;\n if (!usesAppAuth && !user) {\n throw new Error(`Transport ${transport.method} can only handle subscriptions with user context`);\n }\n const jsonBody = {\n type,\n version,\n condition,\n transport,\n };\n if (isBatched) {\n jsonBody.is_batching_enabled = true;\n }\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/subscriptions',\n method: 'POST',\n scopes,\n userId: mapOptional(user, extractUserId),\n canOverrideScopedUserContext,\n forceType: usesAppAuth ? 'app' : 'user',\n jsonBody,\n });\n return new HelixEventSubSubscription(result.data[0], this._client);\n }\n /**\n * Deletes a subscription.\n *\n * @param id The ID of the subscription.\n */\n async deleteSubscription(id) {\n await this._client.callApi({\n type: 'helix',\n url: 'eventsub/subscriptions',\n method: 'DELETE',\n query: {\n id,\n },\n });\n }\n /**\n * Deletes *all* subscriptions.\n */\n async deleteAllSubscriptions() {\n await this._deleteSubscriptionsWithCondition();\n }\n /**\n * Deletes all broken subscriptions, i.e. all that are not enabled or pending verification.\n */\n async deleteBrokenSubscriptions() {\n await this._deleteSubscriptionsWithCondition(sub => sub.status !== 'enabled' && sub.status !== 'webhook_callback_verification_pending');\n }\n /**\n * Subscribe to events that represent a stream going live.\n *\n * @param broadcaster The broadcaster you want to listen to online events for.\n * @param transport The transport options.\n */\n async subscribeToStreamOnlineEvents(broadcaster, transport) {\n return await this.createSubscription('stream.online', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster);\n }\n /**\n * Subscribe to events that represent a stream going offline.\n *\n * @param broadcaster The broadcaster you want to listen to online events for.\n * @param transport The transport options.\n */\n async subscribeToStreamOfflineEvents(broadcaster, transport) {\n return await this.createSubscription('stream.offline', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster);\n }\n /**\n * Subscribe to events that represent a channel updating their metadata.\n *\n * @param broadcaster The broadcaster you want to listen to update events for.\n * @param transport The transport options.\n */\n async subscribeToChannelUpdateEvents(broadcaster, transport) {\n return await this.createSubscription('channel.update', '2', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster);\n }\n /**\n * Subscribe to events that represent a user following a channel.\n *\n * @param broadcaster The broadcaster you want to listen to follow events for.\n * @param transport The transport options.\n */\n async subscribeToChannelFollowEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.follow', '2', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:followers'], true);\n }\n /**\n * Subscribe to events that represent a user subscribing to a channel.\n *\n * @param broadcaster The broadcaster you want to listen to subscribe events for.\n * @param transport The transport options.\n */\n async subscribeToChannelSubscriptionEvents(broadcaster, transport) {\n return await this.createSubscription('channel.subscribe', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:subscriptions']);\n }\n /**\n * Subscribe to events that represent a user gifting another user a subscription to a channel.\n *\n * @param broadcaster The broadcaster you want to listen to subscription gift events for.\n * @param transport The transport options.\n */\n async subscribeToChannelSubscriptionGiftEvents(broadcaster, transport) {\n return await this.createSubscription('channel.subscription.gift', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:subscriptions']);\n }\n /**\n * Subscribe to events that represent a user's subscription to a channel being announced.\n *\n * @param broadcaster The broadcaster you want to listen to subscription message events for.\n * @param transport The transport options.\n */\n async subscribeToChannelSubscriptionMessageEvents(broadcaster, transport) {\n return await this.createSubscription('channel.subscription.message', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:subscriptions']);\n }\n /**\n * Subscribe to events that represent a user's subscription to a channel ending.\n *\n * @param broadcaster The broadcaster you want to listen to subscription end events for.\n * @param transport The transport options.\n */\n async subscribeToChannelSubscriptionEndEvents(broadcaster, transport) {\n return await this.createSubscription('channel.subscription.end', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:subscriptions']);\n }\n /**\n * Subscribe to events that represent a user cheering bits to a channel.\n *\n * @param broadcaster The broadcaster you want to listen to cheer events for.\n * @param transport The transport options.\n */\n async subscribeToChannelCheerEvents(broadcaster, transport) {\n return await this.createSubscription('channel.cheer', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['bits:read']);\n }\n /**\n * Subscribe to events that represent a charity campaign starting in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to charity donation events for.\n * @param transport The transport options.\n */\n async subscribeToChannelCharityCampaignStartEvents(broadcaster, transport) {\n return await this.createSubscription('channel.charity_campaign.start', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:charity']);\n }\n /**\n * Subscribe to events that represent a charity campaign ending in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to charity donation events for.\n * @param transport The transport options.\n */\n async subscribeToChannelCharityCampaignStopEvents(broadcaster, transport) {\n return await this.createSubscription('channel.charity_campaign.stop', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:charity']);\n }\n /**\n * Subscribe to events that represent a user donating to a charity campaign in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to charity donation events for.\n * @param transport The transport options.\n */\n async subscribeToChannelCharityDonationEvents(broadcaster, transport) {\n return await this.createSubscription('channel.charity_campaign.donate', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:charity']);\n }\n /**\n * Subscribe to events that represent a charity campaign progressing in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to charity donation events for.\n * @param transport The transport options.\n */\n async subscribeToChannelCharityCampaignProgressEvents(broadcaster, transport) {\n return await this.createSubscription('channel.charity_campaign.progress', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:charity']);\n }\n /**\n * Subscribe to events that represent a user being banned in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to ban events for.\n * @param transport The transport options.\n */\n async subscribeToChannelBanEvents(broadcaster, transport) {\n return await this.createSubscription('channel.ban', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:moderate']);\n }\n /**\n * Subscribe to events that represent a user being unbanned in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to unban events for.\n * @param transport The transport options.\n */\n async subscribeToChannelUnbanEvents(broadcaster, transport) {\n return await this.createSubscription('channel.unban', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:moderate']);\n }\n /**\n * Subscribe to events that represent Shield Mode being activated in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to Shield Mode activation events for.\n * @param transport The transport options.\n */\n async subscribeToChannelShieldModeBeginEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.shield_mode.begin', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:shield_mode', 'moderator:manage:shield_mode'], true);\n }\n /**\n * Subscribe to events that represent Shield Mode being deactivated in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to Shield Mode deactivation events for.\n * @param transport The transport options.\n */\n async subscribeToChannelShieldModeEndEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.shield_mode.end', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:shield_mode', 'moderator:manage:shield_mode'], true);\n }\n /**\n * Subscribe to events that represent a moderator being added to a channel.\n *\n * @param broadcaster The broadcaster you want to listen for moderator add events for.\n * @param transport The transport options.\n */\n async subscribeToChannelModeratorAddEvents(broadcaster, transport) {\n return await this.createSubscription('channel.moderator.add', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['moderation:read']);\n }\n /**\n * Subscribe to events that represent a moderator being removed from a channel.\n *\n * @param broadcaster The broadcaster you want to listen for moderator remove events for.\n * @param transport The transport options.\n */\n async subscribeToChannelModeratorRemoveEvents(broadcaster, transport) {\n return await this.createSubscription('channel.moderator.remove', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['moderation:read']);\n }\n /**\n * Subscribe to events that represent a broadcaster raiding another broadcaster.\n *\n * @param broadcaster The broadcaster you want to listen to outgoing raid events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRaidEventsFrom(broadcaster, transport) {\n return await this.createSubscription('channel.raid', '1', createSingleKeyQuery('from_broadcaster_user_id', extractUserId(broadcaster)), transport, broadcaster);\n }\n /**\n * Subscribe to events that represent a broadcaster being raided by another broadcaster.\n *\n * @param broadcaster The broadcaster you want to listen to incoming raid events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRaidEventsTo(broadcaster, transport) {\n return await this.createSubscription('channel.raid', '1', createSingleKeyQuery('to_broadcaster_user_id', extractUserId(broadcaster)), transport, broadcaster);\n }\n /**\n * Subscribe to events that represent a Channel Points reward being added to a channel.\n *\n * @param broadcaster The broadcaster you want to listen to reward add events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRewardAddEvents(broadcaster, transport) {\n return await this.createSubscription('channel.channel_points_custom_reward.add', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a Channel Points reward being updated in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to reward update events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRewardUpdateEvents(broadcaster, transport) {\n return await this.createSubscription('channel.channel_points_custom_reward.update', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a specific Channel Points reward being updated.\n *\n * @param broadcaster The broadcaster you want to listen to reward update events for.\n * @param rewardId The ID of the reward you want to listen to update events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRewardUpdateEventsForReward(broadcaster, rewardId, transport) {\n return await this.createSubscription('channel.channel_points_custom_reward.update', '1', createEventSubRewardCondition(broadcaster, rewardId), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a Channel Points reward being removed from a channel.\n *\n * @param broadcaster The broadcaster you want to listen to reward remove events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRewardRemoveEvents(broadcaster, transport) {\n return await this.createSubscription('channel.channel_points_custom_reward.remove', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a specific Channel Points reward being removed from a channel.\n *\n * @param broadcaster The broadcaster you want to listen to reward remove events for.\n * @param rewardId The ID of the reward you want to listen to remove events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRewardRemoveEventsForReward(broadcaster, rewardId, transport) {\n return await this.createSubscription('channel.channel_points_custom_reward.remove', '1', createEventSubRewardCondition(broadcaster, rewardId), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a Channel Points reward being redeemed.\n *\n * @param broadcaster The broadcaster you want to listen to redemption events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRedemptionAddEvents(broadcaster, transport) {\n return await this.createSubscription('channel.channel_points_custom_reward_redemption.add', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a specific Channel Points reward being redeemed.\n *\n * @param broadcaster The broadcaster you want to listen to redemption events for.\n * @param rewardId The ID of the reward you want to listen to redemption events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRedemptionAddEventsForReward(broadcaster, rewardId, transport) {\n return await this.createSubscription('channel.channel_points_custom_reward_redemption.add', '1', createEventSubRewardCondition(broadcaster, rewardId), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a Channel Points redemption being updated.\n *\n * @param broadcaster The broadcaster you want to listen to redemption update events for.\n * @param transport The transport options.\n */\n async subscribeToChannelRedemptionUpdateEvents(broadcaster, transport) {\n return await this.createSubscription('channel.channel_points_custom_reward_redemption.update', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a specific Channel Points reward's redemption being updated.\n *\n * @param broadcaster The broadcaster you want to listen to redemption update events for.\n * @param rewardId The ID of the reward you want to listen to redemption updates for.\n * @param transport The transport options.\n */\n async subscribeToChannelRedemptionUpdateEventsForReward(broadcaster, rewardId, transport) {\n return await this.createSubscription('channel.channel_points_custom_reward_redemption.update', '1', createEventSubRewardCondition(broadcaster, rewardId), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a Channel Points automatic reward being redeemed.\n *\n * @param broadcaster The broadcaster you want to listen to automatic reward redemption events for.\n * @param transport The transport options.\n */\n async subscribeToChannelAutomaticRewardRedemptionAddEvents(broadcaster, transport) {\n return await this.createSubscription('channel.channel_points_automatic_reward_redemption.add', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a Channel Points automatic reward being redeemed.\n *\n * @param broadcaster The broadcaster you want to listen to automatic reward redemption events for.\n * @param transport The transport options.\n */\n async subscribeToChannelAutomaticRewardRedemptionAddV2Events(broadcaster, transport) {\n return await this.createSubscription('channel.channel_points_automatic_reward_redemption.add', '2', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);\n }\n /**\n * Subscribe to events that represent a poll starting in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to poll begin events for.\n * @param transport The transport options.\n */\n async subscribeToChannelPollBeginEvents(broadcaster, transport) {\n return await this.createSubscription('channel.poll.begin', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:polls', 'channel:manage:polls']);\n }\n /**\n * Subscribe to events that represent a poll being voted on in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to poll progress events for.\n * @param transport The transport options.\n */\n async subscribeToChannelPollProgressEvents(broadcaster, transport) {\n return await this.createSubscription('channel.poll.progress', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:polls', 'channel:manage:polls']);\n }\n /**\n * Subscribe to events that represent a poll ending in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to poll end events for.\n * @param transport The transport options.\n */\n async subscribeToChannelPollEndEvents(broadcaster, transport) {\n return await this.createSubscription('channel.poll.end', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:polls', 'channel:manage:polls']);\n }\n /**\n * Subscribe to events that represent a prediction starting in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to prediction begin events for.\n * @param transport The transport options.\n */\n async subscribeToChannelPredictionBeginEvents(broadcaster, transport) {\n return await this.createSubscription('channel.prediction.begin', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:predictions', 'channel:manage:predictions']);\n }\n /**\n * Subscribe to events that represent a prediction being voted on in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to prediction preogress events for.\n * @param transport The transport options.\n */\n async subscribeToChannelPredictionProgressEvents(broadcaster, transport) {\n return await this.createSubscription('channel.prediction.progress', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:predictions', 'channel:manage:predictions']);\n }\n /**\n * Subscribe to events that represent a prediction being locked in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to prediction lock events for.\n * @param transport The transport options.\n */\n async subscribeToChannelPredictionLockEvents(broadcaster, transport) {\n return await this.createSubscription('channel.prediction.lock', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:predictions', 'channel:manage:predictions']);\n }\n /**\n * Subscribe to events that represent a prediction ending in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to prediction end events for.\n * @param transport The transport options.\n */\n async subscribeToChannelPredictionEndEvents(broadcaster, transport) {\n return await this.createSubscription('channel.prediction.end', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:predictions', 'channel:manage:predictions']);\n }\n /**\n * Subscribe to events that represent the beginning of a creator goal event in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to goal begin events for.\n * @param transport The transport options.\n */\n async subscribeToChannelGoalBeginEvents(broadcaster, transport) {\n return await this.createSubscription('channel.goal.begin', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:goals']);\n }\n /**\n * Subscribe to events that represent progress towards a creator goal.\n *\n * @param broadcaster The broadcaster for which you want to listen to goal progress events.\n * @param transport The transport options.\n */\n async subscribeToChannelGoalProgressEvents(broadcaster, transport) {\n return await this.createSubscription('channel.goal.progress', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:goals']);\n }\n /**\n * Subscribe to events that represent the end of a creator goal event.\n *\n * @param broadcaster The broadcaster for which you want to listen to goal end events.\n * @param transport The transport options.\n */\n async subscribeToChannelGoalEndEvents(broadcaster, transport) {\n return await this.createSubscription('channel.goal.end', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:goals']);\n }\n /**\n * Subscribe to events that represent the beginning of a Hype Train event in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to Hype train begin events for.\n * @param transport The transport options.\n */\n async subscribeToChannelHypeTrainBeginEvents(broadcaster, transport) {\n return await this.createSubscription('channel.hype_train.begin', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:hype_train']);\n }\n /**\n * Subscribe to events that represent progress towards the Hype Train goal.\n *\n * @param broadcaster The broadcaster for which you want to listen to Hype Train progress events.\n * @param transport The transport options.\n */\n async subscribeToChannelHypeTrainProgressEvents(broadcaster, transport) {\n return await this.createSubscription('channel.hype_train.progress', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:hype_train']);\n }\n /**\n * Subscribe to events that represent the end of a Hype Train event.\n *\n * @param broadcaster The broadcaster for which you want to listen to Hype Train end events.\n * @param transport The transport options.\n */\n async subscribeToChannelHypeTrainEndEvents(broadcaster, transport) {\n return await this.createSubscription('channel.hype_train.end', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:hype_train']);\n }\n /**\n * Subscribe to events that represent the beginning of a Hype Train event in a channel.\n *\n * @param broadcaster The broadcaster you want to listen to Hype train begin events for.\n * @param transport The transport options.\n */\n async subscribeToChannelHypeTrainBeginV2Events(broadcaster, transport) {\n return await this.createSubscription('channel.hype_train.begin', '2', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:hype_train']);\n }\n /**\n * Subscribe to events that represent progress towards the Hype Train goal.\n *\n * @param broadcaster The broadcaster for which you want to listen to Hype Train progress events.\n * @param transport The transport options.\n */\n async subscribeToChannelHypeTrainProgressV2Events(broadcaster, transport) {\n return await this.createSubscription('channel.hype_train.progress', '2', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:hype_train']);\n }\n /**\n * Subscribe to events that represent the end of a Hype Train event.\n *\n * @param broadcaster The broadcaster for which you want to listen to Hype Train end events.\n * @param transport The transport options.\n */\n async subscribeToChannelHypeTrainEndV2Events(broadcaster, transport) {\n return await this.createSubscription('channel.hype_train.end', '2', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:hype_train']);\n }\n /**\n * Subscribe to events that represent a broadcaster shouting out another broadcaster.\n *\n * @param broadcaster The broadcaster for which you want to listen to outgoing shoutout events.\n * @param transport The transport options.\n */\n async subscribeToChannelShoutoutCreateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.shoutout.create', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:shoutouts', 'moderator:manage:shoutouts'], true);\n }\n /**\n * Subscribe to events that represent a broadcaster being shouting out by another broadcaster.\n *\n * @param broadcaster The broadcaster for which you want to listen to incoming shoutout events.\n * @param transport The transport options.\n */\n async subscribeToChannelShoutoutReceiveEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.shoutout.receive', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:shoutouts', 'moderator:manage:shoutouts'], true);\n }\n /**\n * Subscribe to events that represent an ad break beginning in a channel.\n *\n * @param broadcaster The broadcaster for which you want to listen to ad break begin events.\n * @param transport The transport options.\n */\n async subscribeToChannelAdBreakBeginEvents(broadcaster, transport) {\n return await this.createSubscription('channel.ad_break.begin', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:ads']);\n }\n /**\n * Subscribe to events that represent a channel's chat being cleared.\n *\n * @param broadcaster The broadcaster for which you want to listen to chat clear events.\n * @param transport The transport options.\n */\n async subscribeToChannelChatClearEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.chat.clear', '1', createEventSubUserCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['user:read:chat'], true);\n }\n /**\n * Subscribe to events that represent a user's chat messages being cleared in a channel.\n *\n * @param broadcaster The broadcaster for which you want to listen to user chat message clear events.\n * @param transport The transport options.\n */\n async subscribeToChannelChatClearUserMessagesEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.chat.clear_user_messages', '1', createEventSubUserCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['user:read:chat'], true);\n }\n /**\n * Subscribe to events that represent a chat message being deleted in a channel.\n *\n * @param broadcaster The broadcaster for which you want to listen to chat message delete events.\n * @param transport The transport options.\n */\n async subscribeToChannelChatMessageDeleteEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.chat.message_delete', '1', createEventSubUserCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['user:read:chat'], true);\n }\n /**\n * Subscribe to events that represent a chat notification in a channel.\n *\n * @param broadcaster The broadcaster for which you want to listen to chat notification events.\n * @param transport The transport options.\n */\n async subscribeToChannelChatNotificationEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.chat.notification', '1', createEventSubUserCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['user:read:chat'], true);\n }\n /**\n * Subscribe to events that represent a chat message in a channel.\n *\n * @param broadcaster The broadcaster for which you want to listen to chat message events.\n * @param transport The transport options.\n */\n async subscribeToChannelChatMessageEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.chat.message', '1', createEventSubUserCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['user:read:chat'], true);\n }\n /**\n * Subscribe to events that represent chat settings being updated in a channel.\n *\n * @param broadcaster The broadcaster for which you want to listen to chat settings update events.\n * @param transport The transport options.\n */\n async subscribeToChannelChatSettingsUpdateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.chat_settings.update', '1', createEventSubUserCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['user:read:chat'], true);\n }\n /**\n * Subscribe to events that represent a created unban requests in a channel.\n *\n * @param broadcaster The broadcaster for which you want to listen to unban requests.\n * @param transport The transport options.\n */\n async subscribeToChannelUnbanRequestCreateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.unban_request.create', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:read:unban_requests', 'moderator:manage:unban_requests'], true);\n }\n /**\n * Subscribe to events that represent a resolved unban requests in a channel.\n *\n * @param broadcaster The broadcaster for which you want to listen to unban requests.\n * @param transport The transport options.\n */\n async subscribeToChannelUnbanRequestResolveEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.unban_request.resolve', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:read:unban_requests', 'moderator:manage:unban_requests'], true);\n }\n /**\n * Subscribe to events that represent a moderator performing an action on a channel.\n *\n * This requires the following scopes:\n * - `moderator:read:blocked_terms` OR `moderator:manage:blocked_terms`\n * - `moderator:read:chat_settings` OR `moderator:manage:chat_settings`\n * - `moderator:read:unban_requests` OR `moderator:manage:unban_requests`\n * - `moderator:read:banned_users` OR `moderator:manage:banned_users`\n * - `moderator:read:chat_messages` OR `moderator:manage:chat_messages`\n * - `moderator:read:warnings` OR `moderator:manage:warnings`\n * - `moderator:read:moderators`\n * - `moderator:read:vips`\n *\n * These scope requirements cannot be checked by the library, so they are just assumed.\n * Make sure to catch authorization errors yourself.\n *\n * @param broadcaster The broadcaster for which you want to listen to moderation events.\n * @param transport The transport options.\n */\n async subscribeToChannelModerateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.moderate', '2', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, [], true);\n }\n /**\n * Subscribe to events that represent a warning being acknowledged by a user.\n *\n * @param broadcaster The broadcaster for whom you want to listen to warnings.\n * @param transport The transport options.\n */\n async subscribeToChannelWarningAcknowledgeEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.warning.acknowledge', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:read:warnings', 'moderator:manage:warnings'], true);\n }\n /**\n * Subscribe to events that represent a warning sent to a user.\n *\n * @param broadcaster The broadcaster for whom you want to listen to warnings.\n * @param transport The transport options.\n */\n async subscribeToChannelWarningSendEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.warning.send', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:read:warnings', 'moderator:manage:warnings'], true);\n }\n /**\n * Subscribe to events that represent a VIP being added to a channel.\n *\n * @param broadcaster The broadcaster you want to listen for VIP add events for.\n * @param transport The transport options.\n */\n async subscribeToChannelVipAddEvents(broadcaster, transport) {\n return await this.createSubscription('channel.vip.add', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:vips', 'channel:manage:vips']);\n }\n /**\n * Subscribe to events that represent a VIP being removed from a channel.\n *\n * @param broadcaster The broadcaster you want to listen for VIP remove events for.\n * @param transport The transport options.\n */\n async subscribeToChannelVipRemoveEvents(broadcaster, transport) {\n return await this.createSubscription('channel.vip.remove', '1', createEventSubBroadcasterCondition(broadcaster), transport, broadcaster, ['channel:read:vips', 'channel:manage:vips']);\n }\n /**\n * Subscribe to events that represent an extension Bits transaction.\n *\n * @param clientId The Client ID for the extension you want to listen to Bits transactions for.\n * @param transport The transport options.\n */\n async subscribeToExtensionBitsTransactionCreateEvents(clientId, transport) {\n return await this.createSubscription('extension.bits_transaction.create', '1', createSingleKeyQuery('extension_client_id', clientId), transport);\n }\n /**\n * Subscribe to events that represent a user granting authorization to an application.\n *\n * @param clientId The Client ID for the application you want to listen to authorization grant events for.\n * @param transport The transport options.\n */\n async subscribeToUserAuthorizationGrantEvents(clientId, transport) {\n return await this.createSubscription('user.authorization.grant', '1', createSingleKeyQuery('client_id', clientId), transport);\n }\n /**\n * Subscribe to events that represent a user revoking their authorization from an application.\n *\n * @param clientId The Client ID for the application you want to listen to authorization revoke events for.\n * @param transport The transport options.\n */\n async subscribeToUserAuthorizationRevokeEvents(clientId, transport) {\n return await this.createSubscription('user.authorization.revoke', '1', createSingleKeyQuery('client_id', clientId), transport);\n }\n /**\n * Subscribe to events that represent a user updating their account details.\n *\n * @param user The user you want to listen to user update events for.\n * @param transport The transport options.\n * @param withEmail Whether to request adding the email address of the user to the notification.\n *\n * Only has an effect with the websocket transport.\n * With the webhook transport, this depends solely on the previous authorization given by the user.\n */\n async subscribeToUserUpdateEvents(user, transport, withEmail) {\n return await this.createSubscription('user.update', '1', createSingleKeyQuery('user_id', extractUserId(user)), transport, user, withEmail ? ['user:read:email'] : undefined);\n }\n /**\n * Subscribe to events that represent a user receiving a whisper message from another user.\n *\n * @param user The user you want to listen to whisper message events for.\n * @param transport The transport options.\n */\n async subscribeToUserWhisperMessageEvents(user, transport) {\n return await this.createSubscription('user.whisper.message', '1', createSingleKeyQuery('user_id', extractUserId(user)), transport, user, ['user:read:whispers', 'user:manage:whispers']);\n }\n /**\n * Subscribe to events that represent a drop entitlement being granted.\n *\n * @expandParams\n *\n * @param filter\n * @param transport The transport options.\n */\n async subscribeToDropEntitlementGrantEvents(filter, transport) {\n return await this.createSubscription('drop.entitlement.grant', '1', createEventSubDropEntitlementGrantCondition(filter), transport, undefined, undefined, false, true);\n }\n /**\n * Subscribes to events that represent a chat message being held by AutoMod.\n *\n * @param broadcaster The broadcaster you want to listen to AutoMod message hold events for.\n * @param transport The transport options.\n */\n async subscribeToAutoModMessageHoldEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('automod.message.hold', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:manage:automod'], true);\n }\n /**\n * Subscribes to events that represent a held chat message by AutoMod being resolved.\n *\n * @param broadcaster The broadcaster you want to listen to AutoMod message resolution events for.\n * @param transport The transport options.\n */\n async subscribeToAutoModMessageUpdateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('automod.message.update', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:manage:automod'], true);\n }\n /**\n * Subscribes to events (v2) that represent a chat message being held by AutoMod.\n *\n * @param broadcaster The broadcaster you want to listen to AutoMod message hold events for.\n * @param transport The transport options.\n */\n async subscribeToAutoModMessageHoldV2Events(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('automod.message.hold', '2', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:manage:automod'], true);\n }\n /**\n * Subscribes to events (v2) that represent a held chat message by AutoMod being resolved.\n *\n * @param broadcaster The broadcaster you want to listen to AutoMod message resolution events for.\n * @param transport The transport options.\n */\n async subscribeToAutoModMessageUpdateV2Events(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('automod.message.update', '2', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:manage:automod'], true);\n }\n /**\n * Subscribes to events that represent the AutoMod settings being updated.\n *\n * @param broadcaster The broadcaster you want to listen to AutoMod settings update events.\n * @param transport The transport options.\n */\n async subscribeToAutoModSettingsUpdateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('automod.settings.update', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:read:automod_settings'], true);\n }\n /**\n * Subscribes to events that represent the AutoMod terms being updated.\n *\n * @param broadcaster The broadcaster you want to listen to AutoMod terms update events.\n * @param transport The transport options.\n */\n async subscribeToAutoModTermsUpdateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('automod.terms.update', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:manage:automod'], true);\n }\n /**\n * Subscribes to events that represent a user's notification about their message being held by AutoMod.\n *\n * @param broadcaster The broadcaster you want to listen to AutoMod message hold events for.\n * @param transport The transport options.\n */\n async subscribeToChannelChatUserMessageHoldEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.chat.user_message_hold', '1', createEventSubUserCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['user:read:chat'], true);\n }\n /**\n * Subscribes to events that represent a user's notification about a held chat message by AutoMod being resolved.\n *\n * @param broadcaster The broadcaster you want to listen to AutoMod message resolution events for.\n * @param transport The transport options.\n */\n async subscribeToChannelChatUserMessageUpdateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.chat.user_message_update', '1', createEventSubUserCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['user:read:chat'], true);\n }\n /**\n * Subscribes to events that represent a suspicious user updated in a channel.\n *\n * @param broadcaster The broadcaster you want to listen for suspicious user update events.\n * @param transport The transport options.\n */\n async subscribeToChannelSuspiciousUserUpdateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.suspicious_user.update', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:read:suspicious_users'], true);\n }\n /**\n * Subscribes to events that represent a message sent by a suspicious user.\n *\n * @param broadcaster The broadcaster you want to listen for messages sent by suspicious users.\n * @param transport The transport options.\n */\n async subscribeToChannelSuspiciousUserMessageEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.suspicious_user.message', '1', createEventSubModeratorCondition(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcaster, ['moderator:read:suspicious_users'], true);\n }\n /**\n * Subscribes to events indicating that a shared chat session has begun in a channel.\n *\n * @param broadcaster The broadcaster for whom shared chat session begin events should be listened to.\n * @param transport The transport options to use for the subscription.\n */\n async subscribeToChannelSharedChatSessionBeginEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.shared_chat.begin', '1', createEventSubBroadcasterCondition(broadcasterId), transport, broadcasterId);\n }\n /**\n * Subscribes to events indicating that a shared chat session has been updated in a channel.\n *\n * @param broadcaster The broadcaster for whom shared chat session update events should be listened to.\n * @param transport The transport options to use for the subscription.\n */\n async subscribeToChannelSharedChatSessionUpdateEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.shared_chat.update', '1', createEventSubBroadcasterCondition(broadcasterId), transport, broadcasterId);\n }\n /**\n * Subscribes to events indicating that a shared chat session has ended in a channel.\n *\n * @param broadcaster The broadcaster for whom shared chat session end events should be listened to.\n * @param transport The transport options to use for the subscription.\n */\n async subscribeToChannelSharedChatSessionEndEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.shared_chat.end', '1', createEventSubBroadcasterCondition(broadcasterId), transport, broadcasterId);\n }\n /**\n * Subscribes to events indicating that bits are used in a channel.\n *\n * @param broadcaster The broadcaster for whom you want to listen to bits usage events.\n * @param transport The transport options to use for the subscription.\n */\n async subscribeToChannelBitsUseEvents(broadcaster, transport) {\n const broadcasterId = extractUserId(broadcaster);\n return await this.createSubscription('channel.bits.use', '1', createEventSubBroadcasterCondition(broadcasterId), transport, broadcasterId, ['bits:read']);\n }\n /**\n * Gets the current EventSub conduits for the current client.\n *\n */\n async getConduits() {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/conduits',\n });\n return result.data.map(data => new HelixEventSubConduit(data, this._client));\n }\n /**\n * Creates a new EventSub conduit for the current client.\n *\n * @param shardCount The number of shards to create for this conduit.\n */\n async createConduit(shardCount) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/conduits',\n method: 'POST',\n query: {\n ...createSingleKeyQuery('shard_count', shardCount.toString()),\n },\n });\n return new HelixEventSubConduit(result.data[0], this._client);\n }\n /**\n * Updates an EventSub conduit for the current client.\n *\n * @param id The ID of the conduit to update.\n * @param shardCount The number of shards to update for this conduit.\n */\n async updateConduit(id, shardCount) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/conduits',\n method: 'PATCH',\n query: createEventSubConduitUpdateCondition(id, shardCount),\n });\n return new HelixEventSubConduit(result.data[0], this._client);\n }\n /**\n * Deletes an EventSub conduit for the current client.\n *\n * @param id The ID of the conduit to delete.\n */\n async deleteConduit(id) {\n await this._client.callApi({\n type: 'helix',\n url: 'eventsub/conduits',\n method: 'DELETE',\n query: {\n ...createSingleKeyQuery('id', id),\n },\n });\n }\n /**\n * Gets the shards of an EventSub conduit for the current client.\n *\n * @param conduitId The ID of the conduit to get shards for.\n * @param status The status of the shards to filter by.\n * @param pagination\n */\n async getConduitShards(conduitId, status, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/conduits/shards',\n query: {\n ...createEventSubConduitCondition(conduitId, status),\n ...createPaginationQuery(pagination),\n },\n });\n return {\n ...createPaginatedResult(result, HelixEventSubConduitShard, this._client),\n };\n }\n /**\n * Creates a paginator for the shards of an EventSub conduit for the current client.\n *\n * @param conduitId The ID of the conduit to get shards for.\n * @param status The status of the shards to filter by.\n */\n getConduitShardsPaginated(conduitId, status) {\n return new HelixPaginatedRequest({\n url: 'eventsub/conduits/shards',\n query: createEventSubConduitCondition(conduitId, status),\n }, this._client, data => new HelixEventSubConduitShard(data));\n }\n /**\n * Updates shards of an EventSub conduit for the current client.\n *\n * @param conduitId The ID of the conduit to update shards for.\n * @param shards List of shards to update\n */\n async updateConduitShards(conduitId, shards) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'eventsub/conduits/shards',\n method: 'PATCH',\n jsonBody: createEventSubConduitShardsUpdateCondition(conduitId, shards),\n });\n return result.data.map(data => new HelixEventSubConduitShard(data));\n }\n async _deleteSubscriptionsWithCondition(cond) {\n const subsPaginator = this.getSubscriptionsPaginated();\n for await (const sub of subsPaginator) {\n if (!cond || cond(sub)) {\n await sub.unsubscribe();\n }\n }\n }\n};\nHelixEventSubApi = __decorate([\n rtfm('api', 'HelixEventSubApi')\n], HelixEventSubApi);\nexport { HelixEventSubApi };\n", "/** @internal */\nexport function createReleasedExtensionFilter(extensionId, version) {\n return {\n extension_id: extensionId,\n extension_version: version,\n };\n}\n/** @internal */\nexport function createExtensionProductBody(data) {\n return {\n sku: data.sku,\n cost: {\n amount: data.cost,\n type: 'bits',\n },\n display_name: data.displayName,\n in_development: data.inDevelopment,\n expiration: data.expirationDate,\n is_broadcast: data.broadcast,\n };\n}\n/** @internal */\nexport function createExtensionTransactionQuery(extensionId, filter) {\n return {\n extension_id: extensionId,\n id: filter.transactionIds,\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A reference to a Twitch channel.\n */\nlet HelixChannelReference = class HelixChannelReference extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the channel.\n */\n get id() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The display name of the channel.\n */\n get displayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the channel.\n */\n async getChannel() {\n return checkRelationAssertion(await this._client.channels.getChannelInfoById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * Gets more information about the broadcaster of the channel.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The ID of the game currently played on the channel.\n */\n get gameId() {\n return this[rawDataSymbol].game_id;\n }\n /**\n * The name of the game currently played on the channel.\n */\n get gameName() {\n return this[rawDataSymbol].game_name;\n }\n /**\n * Gets information about the game that is being played on the stream.\n */\n async getGame() {\n return this[rawDataSymbol].game_id\n ? checkRelationAssertion(await this._client.games.getGameById(this[rawDataSymbol].game_id))\n : null;\n }\n /**\n * The title of the channel.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixChannelReference.prototype, \"_client\", void 0);\nHelixChannelReference = __decorate([\n rtfm('api', 'HelixChannelReference', 'id')\n], HelixChannelReference);\nexport { HelixChannelReference };\n", "import { __decorate } from \"tslib\";\nimport { mapNullable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * An extension's product to purchase with Bits.\n */\nlet HelixExtensionBitsProduct = class HelixExtensionBitsProduct extends DataObject {\n /**\n * The product's unique identifier.\n */\n get sku() {\n return this[rawDataSymbol].sku;\n }\n /**\n * The product's cost, in bits.\n */\n get cost() {\n return this[rawDataSymbol].cost.amount;\n }\n /**\n * The product's display name.\n */\n get displayName() {\n return this[rawDataSymbol].display_name;\n }\n /**\n * Whether the product is in development.\n */\n get inDevelopment() {\n return this[rawDataSymbol].in_development;\n }\n /**\n * Whether the product's purchases is broadcast to all users.\n */\n get isBroadcast() {\n return this[rawDataSymbol].is_broadcast;\n }\n /**\n * The product's expiration date. If the product never expires, this is null.\n */\n get expirationDate() {\n return mapNullable(this[rawDataSymbol].expiration, exp => new Date(exp));\n }\n};\nHelixExtensionBitsProduct = __decorate([\n rtfm('api', 'HelixExtensionBitsProduct', 'sku')\n], HelixExtensionBitsProduct);\nexport { HelixExtensionBitsProduct };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A bits transaction made inside an extension.\n */\nlet HelixExtensionTransaction = class HelixExtensionTransaction extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the transaction.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The time when the transaction was made.\n */\n get transactionDate() {\n return new Date(this[rawDataSymbol].timestamp);\n }\n /**\n * The ID of the broadcaster that runs the extension on their channel.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster that runs the extension on their channel.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * The display name of the broadcaster that runs the extension on their channel.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets information about the broadcaster that runs the extension on their channel.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The ID of the user that made the transaction.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user that made the transaction.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user that made the transaction.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets information about the user that made the transaction.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * The product type. Currently always BITS_IN_EXTENSION.\n */\n get productType() {\n return this[rawDataSymbol].product_type;\n }\n /**\n * The product SKU.\n */\n get productSku() {\n return this[rawDataSymbol].product_data.sku;\n }\n /**\n * The cost of the product, in bits.\n */\n get productCost() {\n return this[rawDataSymbol].product_data.cost.amount;\n }\n /**\n * The display name of the product.\n */\n get productDisplayName() {\n return this[rawDataSymbol].product_data.displayName;\n }\n /**\n * Whether the product is in development.\n */\n get productInDevelopment() {\n return this[rawDataSymbol].product_data.inDevelopment;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixExtensionTransaction.prototype, \"_client\", void 0);\nHelixExtensionTransaction = __decorate([\n rtfm('api', 'HelixExtensionTransaction', 'id')\n], HelixExtensionTransaction);\nexport { HelixExtensionTransaction };\n", "import { __decorate } from \"tslib\";\nimport { HelixExtension, rtfm } from '@twurple/common';\nimport { createExtensionProductBody, createExtensionTransactionQuery, createReleasedExtensionFilter, } from '../../interfaces/endpoints/extensions.external.js';\nimport { createSingleKeyQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixChannelReference } from '../channel/HelixChannelReference.js';\nimport { HelixExtensionBitsProduct } from './HelixExtensionBitsProduct.js';\nimport { HelixExtensionTransaction } from './HelixExtensionTransaction.js';\n/**\n * The Helix API methods that deal with extensions.\n *\n * Can be accessed using `client.extensions` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const transactions = await api.extionsions.getExtensionTransactions('abcd');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Extensions\n */\nlet HelixExtensionsApi = class HelixExtensionsApi extends BaseApi {\n /**\n * Gets a released extension by ID.\n *\n * @param extensionId The ID of the extension.\n * @param version The version of the extension. If not given, gets the latest version.\n */\n async getReleasedExtension(extensionId, version) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'extensions/released',\n query: createReleasedExtensionFilter(extensionId, version),\n });\n return new HelixExtension(result.data[0]);\n }\n /**\n * Gets a list of channels that are currently live and have the given extension installed.\n *\n * @param extensionId The ID of the extension.\n * @param pagination\n *\n * @expandParams\n */\n async getLiveChannelsWithExtension(extensionId, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'extensions/live',\n query: {\n ...createSingleKeyQuery('extension_id', extensionId),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResult(result, HelixChannelReference, this._client);\n }\n /**\n * Creates a paginator for channels that are currently live and have the given extension installed.\n *\n * @param extensionId The ID of the extension.\n */\n getLiveChannelsWithExtensionPaginated(extensionId) {\n return new HelixPaginatedRequest({\n url: 'extensions/live',\n query: createSingleKeyQuery('extension_id', extensionId),\n }, this._client, data => new HelixChannelReference(data, this._client));\n }\n /**\n * Gets an extension's Bits products.\n *\n * This only works if the provided token belongs to an extension's client ID,\n * and will return the products for that extension.\n *\n * @param includeDisabled Whether to include disabled/expired products.\n */\n async getExtensionBitsProducts(includeDisabled) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'bits/extensions',\n forceType: 'app',\n query: createSingleKeyQuery('should_include_all', includeDisabled?.toString()),\n });\n return result.data.map(data => new HelixExtensionBitsProduct(data));\n }\n /**\n * Creates or updates a Bits product of an extension.\n *\n * This only works if the provided token belongs to an extension's client ID,\n * and will create/update a product for that extension.\n *\n * @param data\n *\n * @expandParams\n */\n async putExtensionBitsProduct(data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'bits/extensions',\n method: 'PUT',\n forceType: 'app',\n jsonBody: createExtensionProductBody(data),\n });\n return new HelixExtensionBitsProduct(result.data[0]);\n }\n /**\n * Gets a list of transactions for the given extension.\n *\n * @param extensionId The ID of the extension to get transactions for.\n * @param filter Additional filters.\n */\n async getExtensionTransactions(extensionId, filter = {}) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'extensions/transactions',\n forceType: 'app',\n query: {\n ...createExtensionTransactionQuery(extensionId, filter),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixExtensionTransaction, this._client);\n }\n /**\n * Creates a paginator for transactions for the given extension.\n *\n * @param extensionId The ID of the extension to get transactions for.\n * @param filter Additional filters.\n */\n getExtensionTransactionsPaginated(extensionId, filter = {}) {\n return new HelixPaginatedRequest({\n url: 'extensions/transactions',\n forceType: 'app',\n query: createExtensionTransactionQuery(extensionId, filter),\n }, this._client, data => new HelixExtensionTransaction(data, this._client));\n }\n};\nHelixExtensionsApi = __decorate([\n rtfm('api', 'HelixExtensionsApi')\n], HelixExtensionsApi);\nexport { HelixExtensionsApi };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A game as displayed on Twitch.\n */\nlet HelixGame = class HelixGame extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the game.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The name of the game.\n */\n get name() {\n return this[rawDataSymbol].name;\n }\n /**\n * The URL of the box art of the game.\n */\n get boxArtUrl() {\n return this[rawDataSymbol].box_art_url;\n }\n /**\n * The IGDB ID of the game, or null if the game doesn't have an IGDB ID assigned at Twitch.\n */\n get igdbId() {\n return this[rawDataSymbol].igdb_id || null;\n }\n /**\n * Builds the URL of the box art of the game using the given dimensions.\n *\n * @param width The width of the box art.\n * @param height The height of the box art.\n */\n getBoxArtUrl(width, height) {\n return this[rawDataSymbol].box_art_url\n .replace('{width}', width.toString())\n .replace('{height}', height.toString());\n }\n /**\n * Gets streams that are currently playing the game.\n *\n * @param pagination\n * @expandParams\n */\n async getStreams(pagination) {\n return await this._client.streams.getStreams({ ...pagination, game: this[rawDataSymbol].id });\n }\n /**\n * Creates a paginator for streams that are currently playing the game.\n */\n getStreamsPaginated() {\n return this._client.streams.getStreamsPaginated({ game: this[rawDataSymbol].id });\n }\n};\n__decorate([\n Enumerable(false)\n], HelixGame.prototype, \"_client\", void 0);\nHelixGame = __decorate([\n rtfm('api', 'HelixGame', 'id')\n], HelixGame);\nexport { HelixGame };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { rtfm } from '@twurple/common';\nimport { HelixRequestBatcher } from '../../utils/HelixRequestBatcher.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixGame } from './HelixGame.js';\n/**\n * The Helix API methods that deal with games.\n *\n * Can be accessed using `client.games` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const game = await api.games.getGameByName('Hearthstone');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Games\n */\nlet HelixGameApi = class HelixGameApi extends BaseApi {\n /** @internal */\n _getGameByIdBatcher = new HelixRequestBatcher({\n url: 'games',\n }, 'id', 'id', this._client, (data) => new HelixGame(data, this._client));\n /** @internal */\n _getGameByNameBatcher = new HelixRequestBatcher({\n url: 'games',\n }, 'name', 'name', this._client, (data) => new HelixGame(data, this._client));\n /** @internal */\n _getGameByIgdbIdBatcher = new HelixRequestBatcher({\n url: 'games',\n }, 'igdb_id', 'igdb_id', this._client, (data) => new HelixGame(data, this._client));\n /**\n * Gets the game data for the given list of game IDs.\n *\n * @param ids The game IDs you want to look up.\n */\n async getGamesByIds(ids) {\n return await this._getGames('id', ids);\n }\n /**\n * Gets the game data for the given list of game names.\n *\n * @param names The game names you want to look up.\n */\n async getGamesByNames(names) {\n return await this._getGames('name', names);\n }\n /**\n * Gets the game data for the given list of IGDB IDs.\n *\n * @param igdbIds The IGDB IDs you want to look up.\n */\n async getGamesByIgdbIds(igdbIds) {\n return await this._getGames('igdb_id', igdbIds);\n }\n /**\n * Gets the game data for the given game ID.\n *\n * @param id The game ID you want to look up.\n */\n async getGameById(id) {\n const games = await this._getGames('id', [id]);\n return games[0] ?? null;\n }\n /**\n * Gets the game data for the given game name.\n *\n * @param name The game name you want to look up.\n */\n async getGameByName(name) {\n const games = await this._getGames('name', [name]);\n return games[0] ?? null;\n }\n /**\n * Gets the game data for the given IGDB ID.\n *\n * @param igdbId The IGDB ID you want to look up.\n */\n async getGameByIgdbId(igdbId) {\n const games = await this._getGames('igdb_id', [igdbId]);\n return games[0] ?? null;\n }\n /**\n * Gets the game data for the given game ID, batching multiple calls into fewer requests as the API allows.\n *\n * @param id The game ID you want to look up.\n */\n async getGameByIdBatched(id) {\n return await this._getGameByIdBatcher.request(id);\n }\n /**\n * Gets the game data for the given game name, batching multiple calls into fewer requests as the API allows.\n *\n * @param name The game name you want to look up.\n */\n async getGameByNameBatched(name) {\n return await this._getGameByNameBatcher.request(name);\n }\n /**\n * Gets the game data for the given IGDB ID, batching multiple calls into fewer requests as the API allows.\n *\n * @param igdbId The IGDB ID you want to look up.\n */\n async getGameByIgdbIdBatched(igdbId) {\n return await this._getGameByIgdbIdBatcher.request(igdbId);\n }\n /**\n * Gets a list of the most viewed games at the moment.\n *\n * @param pagination\n *\n * @expandParams\n */\n async getTopGames(pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'games/top',\n query: createPaginationQuery(pagination),\n });\n return createPaginatedResult(result, HelixGame, this._client);\n }\n /**\n * Creates a paginator for the most viewed games at the moment.\n */\n getTopGamesPaginated() {\n return new HelixPaginatedRequest({\n url: 'games/top',\n }, this._client, data => new HelixGame(data, this._client));\n }\n /** @internal */\n async _getGames(filterType, filterValues) {\n if (!filterValues.length) {\n return [];\n }\n const result = await this._client.callApi({\n type: 'helix',\n url: 'games',\n query: {\n [filterType]: filterValues,\n },\n });\n return result.data.map(entry => new HelixGame(entry, this._client));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixGameApi.prototype, \"_getGameByIdBatcher\", void 0);\n__decorate([\n Enumerable(false)\n], HelixGameApi.prototype, \"_getGameByNameBatcher\", void 0);\n__decorate([\n Enumerable(false)\n], HelixGameApi.prototype, \"_getGameByIgdbIdBatcher\", void 0);\nHelixGameApi = __decorate([\n rtfm('api', 'HelixGameApi')\n], HelixGameApi);\nexport { HelixGameApi };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A creator goal.\n */\nlet HelixGoal = class HelixGoal extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the goal.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the broadcaster the goal belongs to.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The display name of the broadcaster the goal belongs to.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * The name of the broadcaster the goal belongs to.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * Gets more information about the broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The type of the goal.\n */\n get type() {\n return this[rawDataSymbol].type;\n }\n /**\n * The description of the goal.\n */\n get description() {\n return this[rawDataSymbol].description;\n }\n /**\n * The current value of the goal.\n */\n get currentAmount() {\n return this[rawDataSymbol].current_amount;\n }\n /**\n * The target value of the goal.\n */\n get targetAmount() {\n return this[rawDataSymbol].target_amount;\n }\n /**\n * The date and time when the goal was created.\n */\n get creationDate() {\n return this[rawDataSymbol].created_at;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixGoal.prototype, \"_client\", void 0);\nHelixGoal = __decorate([\n rtfm('api', 'HelixGoal', 'id')\n], HelixGoal);\nexport { HelixGoal };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixGoal } from './HelixGoal.js';\n/**\n * The Helix API methods that deal with creator goals.\n *\n * Can be accessed using `client.goals` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const { data: goals } = await api.helix.goals.getGoals('61369223');\n *\n * @meta category helix\n * @meta categorizedTitle Goals\n */\nlet HelixGoalApi = class HelixGoalApi extends BaseApi {\n async getGoals(broadcaster) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'goals',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:goals'],\n query: createBroadcasterQuery(broadcaster),\n });\n return result.data.map(data => new HelixGoal(data, this._client));\n }\n};\nHelixGoalApi = __decorate([\n rtfm('api', 'HelixGoalApi')\n], HelixGoalApi);\nexport { HelixGoalApi };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A Hype Train contributor.\n */\nlet HelixHypeTrainContribution = class HelixHypeTrainContribution extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the user contributing to the Hype Train.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user contributing to the Hype Train.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user contributing to the Hype Train.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets additional information about the user contributing to the Hype Train.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * The type of the Hype Train contribution.\n */\n get type() {\n return this[rawDataSymbol].type;\n }\n /**\n * The total contribution amount in subs or bits.\n */\n get total() {\n return this[rawDataSymbol].total;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixHypeTrainContribution.prototype, \"_client\", void 0);\nHelixHypeTrainContribution = __decorate([\n rtfm('api', 'HelixHypeTrainContribution', 'userId')\n], HelixHypeTrainContribution);\nexport { HelixHypeTrainContribution };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixHypeTrainContribution } from './HelixHypeTrainContribution.js';\n/**\n * Data about the currently running Hype Train.\n */\nlet HelixHypeTrain = class HelixHypeTrain extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The unique ID of the Hype Train event.\n */\n get eventId() {\n return this[rawDataSymbol].id;\n }\n /**\n * The unique ID of the Hype Train.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The user ID of the broadcaster where the Hype Train is happening.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_user_id;\n }\n /**\n * The name of the broadcaster where the Hype Train is happening.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_user_login;\n }\n /**\n * The display name of the broadcaster where the Hype Train is happening.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_user_name;\n }\n /**\n * Gets more information about the broadcaster where the Hype Train is happening.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_user_id));\n }\n /**\n * The level of the Hype Train.\n */\n get level() {\n return this[rawDataSymbol].level;\n }\n /**\n * The total amount of progress points of the Hype Train.\n */\n get total() {\n return this[rawDataSymbol].total;\n }\n /**\n * The amount progress points for the current level of the Hype Train.\n */\n get progress() {\n return this[rawDataSymbol].progress;\n }\n /**\n * The progress points goal to reach the next Hype Train level.\n */\n get goal() {\n return this[rawDataSymbol].goal;\n }\n /**\n * Array list of the top contributions to the Hype Train event for bits and subs.\n */\n get topContributions() {\n return this[rawDataSymbol].top_contributions.map(cont => new HelixHypeTrainContribution(cont, this._client));\n }\n /**\n * The time when the Hype Train started.\n */\n get startDate() {\n return new Date(this[rawDataSymbol].started_at);\n }\n /**\n * The time when the Hype Train is set to expire.\n */\n get expiryDate() {\n return new Date(this[rawDataSymbol].expires_at);\n }\n /**\n * The type of the Hype Train.\n */\n get type() {\n return this[rawDataSymbol].type;\n }\n /**\n * Whether the Hype Train is a shared train.\n */\n get isSharedTrain() {\n return this[rawDataSymbol].is_shared_train;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixHypeTrain.prototype, \"_client\", void 0);\nHelixHypeTrain = __decorate([\n rtfm('api', 'HelixHypeTrain', 'id')\n], HelixHypeTrain);\nexport { HelixHypeTrain };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * All-time-high Hype Train statistics.\n */\nlet HelixHypeTrainAllTimeHigh = class HelixHypeTrainAllTimeHigh extends DataObject {\n /**\n * The level reached by the all-time-high Hype Train.\n */\n get level() {\n return this[rawDataSymbol].level;\n }\n /**\n * The total amount of contribution points reached by the all-time-high Hype Train.\n */\n get total() {\n return this[rawDataSymbol].total;\n }\n /**\n * The time when the all-time-high Hype Train was achieved.\n */\n get achievementDate() {\n return new Date(this[rawDataSymbol].achieved_at);\n }\n};\nHelixHypeTrainAllTimeHigh = __decorate([\n rtfm('api', 'HelixHypeTrainAllTimeHigh')\n], HelixHypeTrainAllTimeHigh);\nexport { HelixHypeTrainAllTimeHigh };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable, mapNullable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixHypeTrain } from './HelixHypeTrain.js';\nimport { HelixHypeTrainAllTimeHigh } from './HelixHypeTrainAllTimeHigh.js';\n/**\n * Statistics of Hype Trains on a channel.\n */\nlet HelixHypeTrainStatus = class HelixHypeTrainStatus extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The current Hype Train, or null if there is no ongoing Hype Train.\n */\n get current() {\n return mapNullable(this[rawDataSymbol].current, data => new HelixHypeTrain(data, this._client));\n }\n /**\n * The all-time-high Hype Train statistics for this channel, or null if there was no Hype Train yet.\n */\n get allTimeHigh() {\n return mapNullable(this[rawDataSymbol].all_time_high, data => new HelixHypeTrainAllTimeHigh(data));\n }\n /**\n * The all-time-high shared Hype Train statistics for this channel, or null if there was no shared Hype Train yet.\n */\n get sharedAllTimeHigh() {\n return mapNullable(this[rawDataSymbol].shared_all_time_high, data => new HelixHypeTrainAllTimeHigh(data));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixHypeTrainStatus.prototype, \"_client\", void 0);\nHelixHypeTrainStatus = __decorate([\n rtfm('api', 'HelixHypeTrainStatus')\n], HelixHypeTrainStatus);\nexport { HelixHypeTrainStatus };\n", "import { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId } from '@twurple/common';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixHypeTrainStatus } from './HelixHypeTrainStatus.js';\n/**\n * The Helix API methods that deal with Hype Trains.\n *\n * Can be accessed using `client.hypeTrain` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const hypeTrainStatus = await api.hypeTrain.getHypeTrainStatusForBroadcaster('125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Hype Trains\n */\nexport class HelixHypeTrainApi extends BaseApi {\n /**\n * Gets the Hype Train status and statistics for the specified broadcaster.\n *\n * @param broadcaster The broadcaster to fetch Hype Train info for.\n */\n async getHypeTrainStatusForBroadcaster(broadcaster) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'hypetrain/status',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:hype_train'],\n query: {\n ...createBroadcasterQuery(broadcaster),\n },\n });\n return new HelixHypeTrainStatus(result.data[0], this._client);\n }\n}\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createModerationUserListQuery(channel, filter) {\n return {\n broadcaster_id: extractUserId(channel),\n user_id: filter?.userId,\n };\n}\n/** @internal */\nexport function createModeratorModifyQuery(broadcaster, user) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n user_id: extractUserId(user),\n };\n}\n/** @internal */\nexport function createResolveUnbanRequestQuery(broadcaster, moderator, unbanRequestId, approved, resolutionMessage) {\n return {\n unban_request_id: unbanRequestId,\n broadcaster_id: extractUserId(broadcaster),\n moderator_id: extractUserId(moderator),\n status: approved ? 'approved' : 'denied',\n resolution_text: resolutionMessage,\n };\n}\n/** @internal */\nexport function createAutoModProcessBody(user, msgId, allow) {\n return {\n user_id: extractUserId(user),\n msg_id: msgId,\n action: allow ? 'ALLOW' : 'DENY',\n };\n}\n/** @internal */\nexport function createAutoModSettingsBody(data) {\n return {\n overall_level: data.overallLevel,\n aggression: data.aggression,\n bullying: data.bullying,\n disability: data.disability,\n misogyny: data.misogyny,\n race_ethnicity_or_religion: data.raceEthnicityOrReligion,\n sex_based_terms: data.sexBasedTerms,\n sexuality_sex_or_gender: data.sexualitySexOrGender,\n swearing: data.swearing,\n };\n}\n/** @internal */\nexport function createBanUserBody(data) {\n return {\n data: {\n duration: data.duration,\n reason: data.reason,\n user_id: extractUserId(data.user),\n },\n };\n}\n/** @internal */\nexport function createUpdateShieldModeStatusBody(activate) {\n return {\n is_active: activate,\n };\n}\n/** @internal */\nexport function createCheckAutoModStatusBody(data) {\n return {\n data: data.map(entry => ({\n msg_id: entry.messageId,\n msg_text: entry.messageText,\n })),\n };\n}\n/** @internal */\nexport function createWarnUserBody(user, reason) {\n return {\n data: {\n user_id: extractUserId(user),\n reason,\n },\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * The AutoMod settings of a channel.\n */\nlet HelixAutoModSettings = class HelixAutoModSettings extends DataObject {\n /**\n * The ID of the broadcaster for which the AutoMod settings were fetched.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The ID of a user that has permission to moderate the broadcaster's chat room.\n */\n get moderatorId() {\n return this[rawDataSymbol].moderator_id;\n }\n /**\n * The default AutoMod level for the broadcaster. This is null if the broadcaster changed individual settings.\n */\n get overallLevel() {\n return this[rawDataSymbol].overall_level ? this[rawDataSymbol].overall_level : null;\n }\n /**\n * The AutoMod level for discrimination against disability.\n */\n get disability() {\n return this[rawDataSymbol].disability;\n }\n /**\n * The AutoMod level for hostility involving aggression.\n */\n get aggression() {\n return this[rawDataSymbol].aggression;\n }\n /**\n * The AutoMod level for discrimination based on sexuality, sex, or gender.\n */\n get sexualitySexOrGender() {\n return this[rawDataSymbol].sexuality_sex_or_gender;\n }\n /**\n * The AutoMod level for discrimination against women.\n */\n get misogyny() {\n return this[rawDataSymbol].misogyny;\n }\n /**\n * The AutoMod level for hostility involving name calling or insults.\n */\n get bullying() {\n return this[rawDataSymbol].bullying;\n }\n /**\n * The AutoMod level for profanity.\n */\n get swearing() {\n return this[rawDataSymbol].swearing;\n }\n /**\n * The AutoMod level for racial discrimination.\n */\n get raceEthnicityOrReligion() {\n return this[rawDataSymbol].race_ethnicity_or_religion;\n }\n /**\n * The AutoMod level for sexual content.\n */\n get sexBasedTerms() {\n return this[rawDataSymbol].sex_based_terms;\n }\n};\nHelixAutoModSettings = __decorate([\n rtfm('api', 'HelixAutoModSettings', 'broadcasterId')\n], HelixAutoModSettings);\nexport { HelixAutoModSettings };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * The status of a message that says whether it is permitted by AutoMod or not.\n */\nlet HelixAutoModStatus = class HelixAutoModStatus extends DataObject {\n /**\n * The developer-generated ID that was sent with the request data.\n */\n get messageId() {\n return this[rawDataSymbol].msg_id;\n }\n /**\n * Whether the message is permitted by AutoMod or not.\n */\n get isPermitted() {\n return this[rawDataSymbol].is_permitted;\n }\n};\nHelixAutoModStatus = __decorate([\n rtfm('api', 'HelixAutoModStatus', 'messageId')\n], HelixAutoModStatus);\nexport { HelixAutoModStatus };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable, mapNullable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Information about a user who has been banned/timed out.\n *\n * @hideProtected\n */\nlet HelixBanUser = class HelixBanUser extends DataObject {\n /** @internal */ _client;\n /** @internal */ _expiryTimestamp;\n /** @internal */\n constructor(data, expiryTimestamp, client) {\n super(data);\n this._expiryTimestamp = expiryTimestamp;\n this._client = client;\n }\n /**\n * The date and time that the ban/timeout was created.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The date and time that the timeout will end. Is `null` if the user was banned instead of put in a timeout.\n */\n get expiryDate() {\n return mapNullable(this._expiryTimestamp, ts => new Date(ts));\n }\n /**\n * The ID of the moderator that banned or put the user in the timeout.\n */\n get moderatorId() {\n return this[rawDataSymbol].moderator_id;\n }\n /**\n * Gets more information about the moderator that banned or put the user in the timeout.\n */\n async getModerator() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].moderator_id));\n }\n /**\n * The ID of the user that was banned or put in a timeout.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * Gets more information about the user that was banned or put in a timeout.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixBanUser.prototype, \"_client\", void 0);\n__decorate([\n Enumerable(false)\n], HelixBanUser.prototype, \"_expiryTimestamp\", void 0);\nHelixBanUser = __decorate([\n rtfm('api', 'HelixBanUser', 'userId')\n], HelixBanUser);\nexport { HelixBanUser };\n", "import { __decorate } from \"tslib\";\nimport { rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixBanUser } from './HelixBanUser.js';\n/**\n * Information about the ban of a user.\n *\n * @inheritDoc\n */\nlet HelixBan = class HelixBan extends HelixBanUser {\n /** @internal */\n constructor(data, client) {\n super(data, data.expires_at || null, client);\n }\n /**\n * The name of the user that was banned or put in a timeout.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user that was banned or put in a timeout.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * The name of the moderator that banned or put the user in the timeout.\n */\n get moderatorName() {\n return this[rawDataSymbol].moderator_login;\n }\n /**\n * The display name of the moderator that banned or put the user in the timeout.\n */\n get moderatorDisplayName() {\n return this[rawDataSymbol].moderator_name;\n }\n /**\n * The reason why the user was banned or timed out. Returns `null` if no reason was given.\n */\n get reason() {\n return this[rawDataSymbol].reason || null;\n }\n};\nHelixBan = __decorate([\n rtfm('api', 'HelixBan', 'userId')\n], HelixBan);\nexport { HelixBan };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Information about a word or phrase blocked in a broadcaster's channel.\n */\nlet HelixBlockedTerm = class HelixBlockedTerm extends DataObject {\n /**\n * The ID of the broadcaster that owns the list of blocked terms.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The date and time of when the term was blocked.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The date and time of when the blocked term is set to expire. After the block expires, users will be able to use the term in the broadcaster\u2019s chat room.\n * Is `null` if the term was added manually or permanently blocked by AutoMod.\n */\n get expirationDate() {\n return this[rawDataSymbol].expires_at ? new Date(this[rawDataSymbol].expires_at) : null;\n }\n /**\n * An ID that uniquely identifies this blocked term.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the moderator that blocked the word or phrase from being used in the broadcaster\u2019s chat room.\n */\n get moderatorId() {\n return this[rawDataSymbol].moderator_id;\n }\n /**\n * The blocked word or phrase.\n */\n get text() {\n return this[rawDataSymbol].text;\n }\n /**\n * The date and time of when the term was updated.\n */\n get updatedDate() {\n return new Date(this[rawDataSymbol].updated_at);\n }\n};\nHelixBlockedTerm = __decorate([\n rtfm('api', 'HelixBlockedTerm', 'id')\n], HelixBlockedTerm);\nexport { HelixBlockedTerm };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A reference to a Twitch channel where a user is a moderator.\n */\nlet HelixModeratedChannel = class HelixModeratedChannel extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the channel.\n */\n get id() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the channel.\n */\n get name() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the channel.\n */\n get displayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the channel.\n */\n async getChannel() {\n return checkRelationAssertion(await this._client.channels.getChannelInfoById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * Gets more information about the broadcaster of the channel.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixModeratedChannel.prototype, \"_client\", void 0);\nHelixModeratedChannel = __decorate([\n rtfm('api', 'HelixModeratedChannel', 'id')\n], HelixModeratedChannel);\nexport { HelixModeratedChannel };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Information about the moderator status of a user.\n */\nlet HelixModerator = class HelixModerator extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the user.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets more information about the user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixModerator.prototype, \"_client\", void 0);\nHelixModerator = __decorate([\n rtfm('api', 'HelixModerator', 'userId')\n], HelixModerator);\nexport { HelixModerator };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Information about the Shield Mode status of a channel.\n */\nlet HelixShieldModeStatus = class HelixShieldModeStatus extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * Whether Shield Mode is active.\n */\n get isActive() {\n return this[rawDataSymbol].is_active;\n }\n /**\n * The ID of the moderator that last activated Shield Mode.\n */\n get moderatorId() {\n return this[rawDataSymbol].moderator_id;\n }\n /**\n * The name of the moderator that last activated Shield Mode.\n */\n get moderatorName() {\n return this[rawDataSymbol].moderator_login;\n }\n /**\n * The display name of the moderator that last activated Shield Mode.\n */\n get moderatorDisplayName() {\n return this[rawDataSymbol].moderator_name;\n }\n /**\n * Gets more information about the moderator that last activated Shield Mode.\n */\n async getModerator() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].moderator_id));\n }\n /**\n * The date when Shield Mode was last activated. `null` indicates Shield Mode hasn't been previously activated.\n */\n get lastActivationDate() {\n return this[rawDataSymbol].last_activated_at === '' ? null : new Date(this[rawDataSymbol].last_activated_at);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixShieldModeStatus.prototype, \"_client\", void 0);\nHelixShieldModeStatus = __decorate([\n rtfm('api', 'HelixShieldModeStatus')\n], HelixShieldModeStatus);\nexport { HelixShieldModeStatus };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable, mapNullable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A request from a user to be unbanned from a channel.\n */\nlet HelixUnbanRequest = class HelixUnbanRequest extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * Unban request ID.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the broadcaster whose channel is receiving the unban request.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster whose channel is receiving the unban request.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The display name of the broadcaster whose channel is receiving the unban request.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * Gets more information about the broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The ID of the moderator who resolved the unban request.\n *\n * Can be `null` if the request is not resolved.\n */\n get moderatorId() {\n return this[rawDataSymbol].moderator_id;\n }\n /**\n * The name of the moderator who resolved the unban request.\n *\n * Can be `null` if the request is not resolved.\n */\n get moderatorName() {\n return this[rawDataSymbol].moderator_login;\n }\n /**\n * The display name of the moderator who resolved the unban request.\n *\n * Can be `null` if the request is not resolved.\n */\n get moderatorDisplayName() {\n return this[rawDataSymbol].moderator_name;\n }\n /**\n * Gets more information about the moderator.\n */\n async getModerator() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].moderator_id));\n }\n /**\n * The ID of the user who requested to be unbanned.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user who requested to be unbanned.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user who requested to be unbanned.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets more information about the user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * Text message of the unban request from the requesting user.\n */\n get message() {\n return this[rawDataSymbol].text;\n }\n /**\n * The date of when the unban request was created.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The message written by the moderator who resolved the unban request, or `null` if it has not been resolved yet.\n */\n get resolutionMessage() {\n // Can be empty string and null\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n return this[rawDataSymbol].resolution_text || null;\n }\n /**\n * The date when the unban request was resolved, or `null` if it has not been resolved yet.\n */\n get resolutionDate() {\n return mapNullable(this[rawDataSymbol].resolved_at, val => new Date(val));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixUnbanRequest.prototype, \"_client\", void 0);\nHelixUnbanRequest = __decorate([\n rtfm('api', 'HelixUnbanRequest', 'id')\n], HelixUnbanRequest);\nexport { HelixUnbanRequest };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * Information about the warning.\n */\nlet HelixWarning = class HelixWarning extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the channel in which the warning will take effect.\n */\n get broadcasterId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * Gets more information about the broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The ID of the user who applied the warning.\n */\n get moderatorId() {\n return this[rawDataSymbol].moderator_id;\n }\n /**\n * Gets more information about the moderator.\n */\n async getModerator() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].moderator_id));\n }\n /**\n * The ID of the warned user.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * Gets more information about the user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * The reason provided for the warning.\n */\n get reason() {\n return this[rawDataSymbol].reason;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixWarning.prototype, \"_client\", void 0);\nHelixWarning = __decorate([\n rtfm('api', 'HelixWarning', 'userId')\n], HelixWarning);\nexport { HelixWarning };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createModeratorActionQuery, createSingleKeyQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { createAutoModProcessBody, createAutoModSettingsBody, createBanUserBody, createCheckAutoModStatusBody, createModerationUserListQuery, createModeratorModifyQuery, createResolveUnbanRequestQuery, createUpdateShieldModeStatusBody, createWarnUserBody, } from '../../interfaces/endpoints/moderation.external.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixAutoModSettings } from './HelixAutoModSettings.js';\nimport { HelixAutoModStatus } from './HelixAutoModStatus.js';\nimport { HelixBan } from './HelixBan.js';\nimport { HelixBanUser } from './HelixBanUser.js';\nimport { HelixBlockedTerm } from './HelixBlockedTerm.js';\nimport { HelixModeratedChannel } from './HelixModeratedChannel.js';\nimport { HelixModerator } from './HelixModerator.js';\nimport { HelixShieldModeStatus } from './HelixShieldModeStatus.js';\nimport { HelixUnbanRequest } from './HelixUnbanRequest.js';\nimport { HelixWarning } from './HelixWarning.js';\n/**\n * The Helix API methods that deal with moderation.\n *\n * Can be accessed using `client.moderation` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const { data: users } = await api.moderation.getBannedUsers('61369223');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Moderation\n */\nlet HelixModerationApi = class HelixModerationApi extends BaseApi {\n /**\n * Gets a list of banned users in a given channel.\n *\n * @param channel The channel to get the banned users from.\n * @param filter Additional filters for the result set.\n *\n * @expandParams\n */\n async getBannedUsers(channel, filter) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/banned',\n userId: extractUserId(channel),\n scopes: ['moderation:read'],\n query: {\n ...createModerationUserListQuery(channel, filter),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixBan, this._client);\n }\n /**\n * Creates a paginator for banned users in a given channel.\n *\n * @param channel The channel to get the banned users from.\n */\n getBannedUsersPaginated(channel) {\n return new HelixPaginatedRequest({\n url: 'moderation/banned',\n userId: extractUserId(channel),\n scopes: ['moderation:read'],\n query: createBroadcasterQuery(channel),\n }, this._client, data => new HelixBan(data, this._client), 50);\n }\n /**\n * Checks whether a given user is banned in a given channel.\n *\n * @param channel The channel to check for a ban of the given user.\n * @param user The user to check for a ban in the given channel.\n */\n async checkUserBan(channel, user) {\n const userId = extractUserId(user);\n const result = await this.getBannedUsers(channel, { userId });\n return result.data.some(ban => ban.userId === userId);\n }\n /**\n * Gets a list of moderators in a given channel.\n *\n * @param channel The channel to get moderators from.\n * @param filter Additional filters for the result set.\n *\n * @expandParams\n */\n async getModerators(channel, filter) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/moderators',\n userId: extractUserId(channel),\n scopes: ['moderation:read', 'channel:manage:moderators'],\n query: {\n ...createModerationUserListQuery(channel, filter),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixModerator, this._client);\n }\n /**\n * Creates a paginator for moderators in a given channel.\n *\n * @param channel The channel to get moderators from.\n */\n getModeratorsPaginated(channel) {\n return new HelixPaginatedRequest({\n url: 'moderation/moderators',\n userId: extractUserId(channel),\n scopes: ['moderation:read', 'channel:manage:moderators'],\n query: createBroadcasterQuery(channel),\n }, this._client, data => new HelixModerator(data, this._client));\n }\n /**\n * Gets a list of channels where the specified user has moderator privileges.\n *\n * @param user The user for whom to return a list of channels where they have moderator privileges.\n * This ID must match the user ID in the access token.\n * @param filter\n *\n * @expandParams\n *\n * @returns A paginated list of channels where the user has moderator privileges.\n */\n async getModeratedChannels(user, filter) {\n const userId = extractUserId(user);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/channels',\n userId,\n scopes: ['user:read:moderated_channels'],\n query: {\n ...createSingleKeyQuery('user_id', userId),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixModeratedChannel, this._client);\n }\n /**\n * Creates a paginator for channels where the specified user has moderator privileges.\n *\n * @param user The user for whom to return the list of channels where they have moderator privileges.\n * This ID must match the user ID in the access token.\n */\n getModeratedChannelsPaginated(user) {\n const userId = extractUserId(user);\n return new HelixPaginatedRequest({\n url: 'moderation/channels',\n userId,\n scopes: ['user:read:moderated_channels'],\n query: createSingleKeyQuery('user_id', userId),\n }, this._client, data => new HelixModeratedChannel(data, this._client));\n }\n /**\n * Checks whether a given user is a moderator of a given channel.\n *\n * @param channel The channel to check.\n * @param user The user to check.\n */\n async checkUserMod(channel, user) {\n const userId = extractUserId(user);\n const result = await this.getModerators(channel, { userId });\n return result.data.some(mod => mod.userId === userId);\n }\n /**\n * Adds a moderator to the broadcaster\u2019s chat room.\n *\n * @param broadcaster The broadcaster that owns the chat room. This ID must match the user ID in the access token.\n * @param user The user to add as a moderator in the broadcaster\u2019s chat room.\n */\n async addModerator(broadcaster, user) {\n await this._client.callApi({\n type: 'helix',\n url: 'moderation/moderators',\n method: 'POST',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:moderators'],\n query: createModeratorModifyQuery(broadcaster, user),\n });\n }\n /**\n * Removes a moderator from the broadcaster\u2019s chat room.\n *\n * @param broadcaster The broadcaster that owns the chat room. This ID must match the user ID in the access token.\n * @param user The user to remove as a moderator from the broadcaster\u2019s chat room.\n */\n async removeModerator(broadcaster, user) {\n await this._client.callApi({\n type: 'helix',\n url: 'moderation/moderators',\n method: 'DELETE',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:moderators'],\n query: createModeratorModifyQuery(broadcaster, user),\n });\n }\n /**\n * Determines whether a string message meets the channel's AutoMod requirements.\n *\n * @param channel The channel in which the messages to check are posted.\n * @param data An array of message data objects.\n */\n async checkAutoModStatus(channel, data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/enforcements/status',\n method: 'POST',\n userId: extractUserId(channel),\n scopes: ['moderation:read'],\n query: createBroadcasterQuery(channel),\n jsonBody: createCheckAutoModStatusBody(data),\n });\n return result.data.map(statusData => new HelixAutoModStatus(statusData));\n }\n /**\n * Processes a message held by AutoMod.\n *\n * @param user The user who is processing the message.\n * @param msgId The ID of the message.\n * @param allow Whether to allow the message - `true` allows, and `false` denies.\n */\n async processHeldAutoModMessage(user, msgId, allow) {\n await this._client.callApi({\n type: 'helix',\n url: 'moderation/automod/message',\n method: 'POST',\n userId: extractUserId(user),\n scopes: ['moderator:manage:automod'],\n jsonBody: createAutoModProcessBody(user, msgId, allow),\n });\n }\n /**\n * Gets the AutoMod settings for a broadcaster.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster to get the AutoMod settings for.\n */\n async getAutoModSettings(broadcaster) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/automod/settings',\n userId: broadcasterId,\n scopes: ['moderator:read:automod_settings'],\n canOverrideScopedUserContext: true,\n query: this._createModeratorActionQuery(broadcasterId),\n });\n return result.data.map(data => new HelixAutoModSettings(data));\n }\n /**\n * Updates the AutoMod settings for a broadcaster.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster for which the AutoMod settings are updated.\n * @param data The updated AutoMod settings that replace the current AutoMod settings.\n */\n async updateAutoModSettings(broadcaster, data) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/automod/settings',\n method: 'PUT',\n userId: broadcasterId,\n scopes: ['moderator:manage:automod_settings'],\n canOverrideScopedUserContext: true,\n query: this._createModeratorActionQuery(broadcasterId),\n jsonBody: createAutoModSettingsBody(data),\n });\n return result.data.map(settingsData => new HelixAutoModSettings(settingsData));\n }\n /**\n * Bans or times out a user in a channel.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster in whose channel the user will be banned/timed out.\n * @param data\n *\n * @expandParams\n *\n * @returns The result data from the ban/timeout request.\n */\n async banUser(broadcaster, data) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/bans',\n method: 'POST',\n userId: broadcasterId,\n scopes: ['moderator:manage:banned_users'],\n canOverrideScopedUserContext: true,\n query: this._createModeratorActionQuery(broadcasterId),\n jsonBody: createBanUserBody(data),\n });\n return result.data.map(banData => new HelixBanUser(banData, banData.end_time, this._client));\n }\n /**\n * Unbans/removes the timeout for a user in a channel.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster in whose channel the user will be unbanned/removed from timeout.\n * @param user The user who will be unbanned/removed from timeout.\n */\n async unbanUser(broadcaster, user) {\n const broadcasterId = extractUserId(broadcaster);\n await this._client.callApi({\n type: 'helix',\n url: 'moderation/bans',\n method: 'DELETE',\n userId: broadcasterId,\n scopes: ['moderator:manage:banned_users'],\n canOverrideScopedUserContext: true,\n query: {\n ...this._createModeratorActionQuery(broadcasterId),\n ...createSingleKeyQuery('user_id', extractUserId(user)),\n },\n });\n }\n /**\n * Gets the broadcaster\u2019s list of non-private, blocked words or phrases.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster to get their channel's blocked terms for.\n * @param pagination\n *\n * @expandParams\n *\n * @returns A paginated list of blocked term data in the broadcaster's channel.\n */\n async getBlockedTerms(broadcaster, pagination) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/blocked_terms',\n userId: broadcasterId,\n scopes: ['moderator:read:blocked_terms'],\n canOverrideScopedUserContext: true,\n query: {\n ...this._createModeratorActionQuery(broadcasterId),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResult(result, HelixBlockedTerm, this._client);\n }\n /**\n * Adds a blocked term to the broadcaster's channel.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster in whose channel the term will be blocked.\n * @param text The word or phrase to block from being used in the broadcaster's channel.\n *\n * @returns Information about the term that has been blocked.\n */\n async addBlockedTerm(broadcaster, text) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/blocked_terms',\n method: 'POST',\n userId: broadcasterId,\n scopes: ['moderator:manage:blocked_terms'],\n canOverrideScopedUserContext: true,\n query: this._createModeratorActionQuery(broadcasterId),\n jsonBody: {\n text,\n },\n });\n return result.data.map(blockedTermData => new HelixBlockedTerm(blockedTermData));\n }\n /**\n * Removes a blocked term from the broadcaster's channel.\n *\n * @param broadcaster The broadcaster in whose channel the term will be unblocked.\n * @param moderator A user that has permission to unblock terms in the broadcaster's channel.\n * The token of this user will be used to remove the blocked term.\n * @param id The ID of the term that should be unblocked.\n */\n async removeBlockedTerm(broadcaster, moderator, id) {\n const broadcasterId = extractUserId(broadcaster);\n await this._client.callApi({\n type: 'helix',\n url: 'moderation/blocked_terms',\n method: 'DELETE',\n userId: broadcasterId,\n scopes: ['moderator:manage:blocked_terms'],\n canOverrideScopedUserContext: true,\n query: {\n ...this._createModeratorActionQuery(broadcasterId),\n id,\n },\n });\n }\n /**\n * Removes a single chat message or all chat messages from the broadcaster\u2019s chat room.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster the chat belongs to.\n * @param messageId The ID of the message to remove. If not specified, the request removes all messages in the broadcaster\u2019s chat room.\n */\n async deleteChatMessages(broadcaster, messageId) {\n const broadcasterId = extractUserId(broadcaster);\n await this._client.callApi({\n type: 'helix',\n url: 'moderation/chat',\n method: 'DELETE',\n userId: broadcasterId,\n scopes: ['moderator:manage:chat_messages'],\n canOverrideScopedUserContext: true,\n query: {\n ...this._createModeratorActionQuery(broadcasterId),\n ...createSingleKeyQuery('message_id', messageId),\n },\n });\n }\n /**\n * Gets the broadcaster's Shield Mode activation status.\n *\n * @param broadcaster The broadcaster whose Shield Mode activation status you want to get.\n */\n async getShieldModeStatus(broadcaster) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/shield_mode',\n method: 'GET',\n userId: broadcasterId,\n scopes: ['moderator:read:shield_mode', 'moderator:manage:shield_mode'],\n canOverrideScopedUserContext: true,\n query: this._createModeratorActionQuery(broadcasterId),\n });\n return new HelixShieldModeStatus(result.data[0], this._client);\n }\n /**\n * Activates or deactivates the broadcaster's Shield Mode.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The broadcaster whose Shield Mode you want to activate or deactivate.\n * @param activate The desired Shield Mode status on the broadcaster's channel.\n */\n async updateShieldModeStatus(broadcaster, activate) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/shield_mode',\n method: 'PUT',\n userId: broadcasterId,\n scopes: ['moderator:manage:shield_mode'],\n canOverrideScopedUserContext: true,\n query: this._createModeratorActionQuery(broadcasterId),\n jsonBody: createUpdateShieldModeStatusBody(activate),\n });\n return new HelixShieldModeStatus(result.data[0], this._client);\n }\n /**\n * Gets a list of unban requests.\n *\n * @param broadcaster The broadcaster to get unban requests of.\n * @param status The status of unban requests to retrieve.\n * @param filter Additional filters for the result set.\n */\n async getUnbanRequests(broadcaster, status, filter) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/unban_requests',\n method: 'GET',\n userId: broadcasterId,\n scopes: ['moderator:read:unban_requests', 'moderator:manage:unban_requests'],\n canOverrideScopedUserContext: true,\n query: {\n ...this._createModeratorActionQuery(broadcasterId),\n ...createSingleKeyQuery('status', status),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixUnbanRequest, this._client);\n }\n /**\n * Creates a paginator for unban requests.\n *\n * @param broadcaster The broadcaster to get unban requests of.\n * @param status The status of unban requests to retrieve.\n */\n getUnbanRequestsPaginated(broadcaster, status) {\n const broadcasterId = extractUserId(broadcaster);\n return new HelixPaginatedRequest({\n url: 'moderation/unban_requests',\n method: 'GET',\n userId: broadcasterId,\n scopes: ['moderator:read:unban_requests', 'moderator:manage:unban_requests'],\n canOverrideScopedUserContext: true,\n query: {\n ...this._createModeratorActionQuery(broadcasterId),\n ...createSingleKeyQuery('status', status),\n },\n }, this._client, data => new HelixUnbanRequest(data, this._client));\n }\n /**\n * Resolves an unban request by approving or denying it.\n *\n * This uses the token of the broadcaster by default.\n * If you want to execute this in the context of another user (who has to be moderator of the channel)\n * you can do so using [user context overrides](/docs/auth/concepts/context-switching).\n *\n * @param broadcaster The ID of the broadcaster whose channel is approving or denying the unban request.\n * @param unbanRequestId The ID of the unban request to resolve.\n * @param approved Whether to approve or deny the unban request.\n * @param resolutionMessage Message supplied by the unban request resolver.\n *\n * The message is limited to a maximum of 500 characters.\n */\n async resolveUnbanRequest(broadcaster, unbanRequestId, approved, resolutionMessage) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/unban_requests',\n method: 'PATCH',\n userId: broadcasterId,\n scopes: ['moderator:manage:unban_requests'],\n canOverrideScopedUserContext: true,\n query: createResolveUnbanRequestQuery(broadcasterId, this._getUserContextIdWithDefault(broadcasterId), unbanRequestId, approved, resolutionMessage?.slice(0, 500)),\n });\n return new HelixUnbanRequest(result.data[0], this._client);\n }\n /**\n * Warns a user in the specified broadcaster\u2019s chat room, preventing them from chat interaction until the\n * warning is acknowledged.\n *\n * New warnings can be issued to a user when they already have a warning in the channel\n * (new warning will replace old warning).\n *\n * @param broadcaster The ID of the broadcaster in which channel the warning will take effect.\n * @param user The ID of the user to be warned.\n * @param reason A custom reason for the warning. Max 500 chars.\n */\n async warnUser(broadcaster, user, reason) {\n const broadcasterId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'moderation/warnings',\n method: 'POST',\n userId: broadcasterId,\n scopes: ['moderator:manage:warnings'],\n canOverrideScopedUserContext: true,\n query: this._createModeratorActionQuery(broadcasterId),\n jsonBody: createWarnUserBody(user, reason.slice(0, 500)),\n });\n return new HelixWarning(result.data[0], this._client);\n }\n _createModeratorActionQuery(broadcasterId) {\n return createModeratorActionQuery(broadcasterId, this._getUserContextIdWithDefault(broadcasterId));\n }\n};\nHelixModerationApi = __decorate([\n rtfm('api', 'HelixModerationApi')\n], HelixModerationApi);\nexport { HelixModerationApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createPollBody(broadcaster, data) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n title: data.title,\n choices: data.choices.map(title => ({ title })),\n duration: data.duration,\n channel_points_voting_enabled: data.channelPointsPerVote != null,\n channel_points_per_vote: data.channelPointsPerVote ?? 0,\n };\n}\n/** @internal */\nexport function createPollEndBody(broadcaster, id, showResult) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n id,\n status: showResult ? 'TERMINATED' : 'ARCHIVED',\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A choice in a channel poll.\n */\nlet HelixPollChoice = class HelixPollChoice extends DataObject {\n /**\n * The ID of the choice.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The title of the choice.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The total votes the choice received.\n */\n get totalVotes() {\n return this[rawDataSymbol].votes;\n }\n /**\n * The votes the choice received by spending channel points.\n */\n get channelPointsVotes() {\n return this[rawDataSymbol].channel_points_votes;\n }\n};\nHelixPollChoice = __decorate([\n rtfm('api', 'HelixPollChoice', 'id')\n], HelixPollChoice);\nexport { HelixPollChoice };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixPollChoice } from './HelixPollChoice.js';\n/**\n * A channel poll.\n */\nlet HelixPoll = class HelixPoll extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the poll.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the broadcaster.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the broadcaster.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The title of the poll.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * Whether voting with channel points is enabled for the poll.\n */\n get isChannelPointsVotingEnabled() {\n return this[rawDataSymbol].channel_points_voting_enabled;\n }\n /**\n * The amount of channel points that a vote costs.\n */\n get channelPointsPerVote() {\n return this[rawDataSymbol].channel_points_per_vote;\n }\n /**\n * The status of the poll.\n */\n get status() {\n return this[rawDataSymbol].status;\n }\n /**\n * The duration of the poll, in seconds.\n */\n get durationInSeconds() {\n return this[rawDataSymbol].duration;\n }\n /**\n * The date when the poll started.\n */\n get startDate() {\n return new Date(this[rawDataSymbol].started_at);\n }\n /**\n * The date when the poll ended or will end.\n */\n get endDate() {\n return new Date(this.startDate.getTime() + this[rawDataSymbol].duration * 1000);\n }\n /**\n * The choices of the poll.\n */\n get choices() {\n return this[rawDataSymbol].choices.map(data => new HelixPollChoice(data));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixPoll.prototype, \"_client\", void 0);\nHelixPoll = __decorate([\n rtfm('api', 'HelixPoll', 'id')\n], HelixPoll);\nexport { HelixPoll };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createGetByIdsQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { createPollBody, createPollEndBody } from '../../interfaces/endpoints/poll.external.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixPoll } from './HelixPoll.js';\n/**\n * The Helix API methods that deal with polls.\n *\n * Can be accessed using `client.polls` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const { data: polls } = await api.helix.polls.getPolls('61369223');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Polls\n */\nlet HelixPollApi = class HelixPollApi extends BaseApi {\n /**\n * Gets a list of polls for the given broadcaster.\n *\n * @param broadcaster The broadcaster to get polls for.\n * @param pagination\n *\n * @expandParams\n */\n async getPolls(broadcaster, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'polls',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:polls', 'channel:manage:polls'],\n query: {\n ...createBroadcasterQuery(broadcaster),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResult(result, HelixPoll, this._client);\n }\n /**\n * Creates a paginator for polls for the given broadcaster.\n *\n * @param broadcaster The broadcaster to get polls for.\n */\n getPollsPaginated(broadcaster) {\n return new HelixPaginatedRequest({\n url: 'polls',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:polls', 'channel:manage:polls'],\n query: createBroadcasterQuery(broadcaster),\n }, this._client, data => new HelixPoll(data, this._client), 20);\n }\n /**\n * Gets polls by IDs.\n *\n * @param broadcaster The broadcaster to get the polls for.\n * @param ids The IDs of the polls.\n */\n async getPollsByIds(broadcaster, ids) {\n if (!ids.length) {\n return [];\n }\n const result = await this._client.callApi({\n type: 'helix',\n url: 'polls',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:polls', 'channel:manage:polls'],\n query: createGetByIdsQuery(broadcaster, ids),\n });\n return result.data.map(data => new HelixPoll(data, this._client));\n }\n /**\n * Gets a poll by ID.\n *\n * @param broadcaster The broadcaster to get the poll for.\n * @param id The ID of the poll.\n */\n async getPollById(broadcaster, id) {\n const polls = await this.getPollsByIds(broadcaster, [id]);\n return polls.length ? polls[0] : null;\n }\n /**\n * Creates a new poll.\n *\n * @param broadcaster The broadcaster to create the poll for.\n * @param data\n *\n * @expandParams\n */\n async createPoll(broadcaster, data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'polls',\n method: 'POST',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:polls'],\n jsonBody: createPollBody(broadcaster, data),\n });\n return new HelixPoll(result.data[0], this._client);\n }\n /**\n * Ends a poll.\n *\n * @param broadcaster The broadcaster to end the poll for.\n * @param id The ID of the poll to end.\n * @param showResult Whether to allow the result to be viewed publicly.\n */\n async endPoll(broadcaster, id, showResult = true) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'polls',\n method: 'PATCH',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:polls'],\n jsonBody: createPollEndBody(broadcaster, id, showResult),\n });\n return new HelixPoll(result.data[0], this._client);\n }\n};\nHelixPollApi = __decorate([\n rtfm('api', 'HelixPollApi')\n], HelixPollApi);\nexport { HelixPollApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createPredictionBody(broadcaster, data) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n title: data.title,\n outcomes: data.outcomes.map(title => ({ title })),\n prediction_window: data.autoLockAfter,\n };\n}\n/** @internal */\nexport function createEndPredictionBody(broadcaster, id, status, outcomeId) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n id,\n status,\n winning_outcome_id: outcomeId,\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A user that took part in a prediction.\n */\nlet HelixPredictor = class HelixPredictor extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The user ID of the predictor.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the predictor.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the predictor.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets more information about the predictor.\n */\n async getUser() {\n return await this._client.users.getUserById(this[rawDataSymbol].user_id);\n }\n /**\n * The amount of channel points the predictor used for the prediction.\n */\n get channelPointsUsed() {\n return this[rawDataSymbol].channel_points_used;\n }\n /**\n * The amount of channel points the predictor won for the prediction, or null if the prediction is not resolved yet, was cancelled or lost.\n */\n get channelPointsWon() {\n return this[rawDataSymbol].channel_points_won;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixPredictor.prototype, \"_client\", void 0);\nHelixPredictor = __decorate([\n rtfm('api', 'HelixPredictor', 'userId')\n], HelixPredictor);\nexport { HelixPredictor };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixPredictor } from './HelixPredictor.js';\n/**\n * A possible outcome in a channel prediction.\n */\nlet HelixPredictionOutcome = class HelixPredictionOutcome extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the outcome.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The title of the outcome.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The number of users that guessed the outcome.\n */\n get users() {\n return this[rawDataSymbol].users;\n }\n /**\n * The total number of channel points that were spent on guessing the outcome.\n */\n get totalChannelPoints() {\n return this[rawDataSymbol].channel_points;\n }\n /**\n * The color of the outcome.\n */\n get color() {\n return this[rawDataSymbol].color;\n }\n /**\n * The top predictors of the outcome.\n */\n get topPredictors() {\n return this[rawDataSymbol].top_predictors?.map(data => new HelixPredictor(data, this._client)) ?? [];\n }\n};\n__decorate([\n Enumerable(false)\n], HelixPredictionOutcome.prototype, \"_client\", void 0);\nHelixPredictionOutcome = __decorate([\n rtfm('api', 'HelixPredictionOutcome', 'id')\n], HelixPredictionOutcome);\nexport { HelixPredictionOutcome };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, HellFreezesOverError, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixPredictionOutcome } from './HelixPredictionOutcome.js';\n/**\n * A channel prediction.\n */\nlet HelixPrediction = class HelixPrediction extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the prediction.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the broadcaster.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the broadcaster.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The title of the prediction.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The status of the prediction.\n */\n get status() {\n return this[rawDataSymbol].status;\n }\n /**\n * The time after which the prediction will be automatically locked, in seconds from creation.\n */\n get autoLockAfter() {\n return this[rawDataSymbol].prediction_window;\n }\n /**\n * The date when the prediction started.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The date when the prediction ended, or null if it didn't end yet.\n */\n get endDate() {\n return this[rawDataSymbol].ended_at ? new Date(this[rawDataSymbol].ended_at) : null;\n }\n /**\n * The date when the prediction was locked, or null if it wasn't locked yet.\n */\n get lockDate() {\n return this[rawDataSymbol].locked_at ? new Date(this[rawDataSymbol].locked_at) : null;\n }\n /**\n * The possible outcomes of the prediction.\n */\n get outcomes() {\n return this[rawDataSymbol].outcomes.map(data => new HelixPredictionOutcome(data, this._client));\n }\n /**\n * The ID of the winning outcome, or null if the prediction is currently running or was canceled.\n */\n get winningOutcomeId() {\n // can apparently be empty string\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n return this[rawDataSymbol].winning_outcome_id || null;\n }\n /**\n * The winning outcome, or null if the prediction is currently running or was canceled.\n */\n get winningOutcome() {\n if (!this[rawDataSymbol].winning_outcome_id) {\n return null;\n }\n const found = this[rawDataSymbol].outcomes.find(o => o.id === this[rawDataSymbol].winning_outcome_id);\n if (!found) {\n throw new HellFreezesOverError('Winning outcome not found in outcomes array');\n }\n return new HelixPredictionOutcome(found, this._client);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixPrediction.prototype, \"_client\", void 0);\nHelixPrediction = __decorate([\n rtfm('api', 'HelixPrediction', 'id')\n], HelixPrediction);\nexport { HelixPrediction };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createGetByIdsQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { createEndPredictionBody, createPredictionBody, } from '../../interfaces/endpoints/prediction.external.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixPrediction } from './HelixPrediction.js';\n/**\n * The Helix API methods that deal with predictions.\n *\n * Can be accessed using `client.predictions` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const { data: predictions } = await api.helix.predictions.getPredictions('61369223');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Predictions\n */\nlet HelixPredictionApi = class HelixPredictionApi extends BaseApi {\n /**\n * Gets a list of predictions for the given broadcaster.\n *\n * @param broadcaster The broadcaster to get predictions for.\n * @param pagination\n *\n * @expandParams\n */\n async getPredictions(broadcaster, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'predictions',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:predictions'],\n query: {\n ...createBroadcasterQuery(broadcaster),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResult(result, HelixPrediction, this._client);\n }\n /**\n * Creates a paginator for predictions for the given broadcaster.\n *\n * @param broadcaster The broadcaster to get predictions for.\n */\n getPredictionsPaginated(broadcaster) {\n return new HelixPaginatedRequest({\n url: 'predictions',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:predictions'],\n query: createBroadcasterQuery(broadcaster),\n }, this._client, data => new HelixPrediction(data, this._client), 20);\n }\n /**\n * Gets predictions by IDs.\n *\n * @param broadcaster The broadcaster to get the predictions for.\n * @param ids The IDs of the predictions.\n */\n async getPredictionsByIds(broadcaster, ids) {\n if (!ids.length) {\n return [];\n }\n const result = await this._client.callApi({\n type: 'helix',\n url: 'predictions',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:predictions'],\n query: createGetByIdsQuery(broadcaster, ids),\n });\n return result.data.map(data => new HelixPrediction(data, this._client));\n }\n /**\n * Gets a prediction by ID.\n *\n * @param broadcaster The broadcaster to get the prediction for.\n * @param id The ID of the prediction.\n */\n async getPredictionById(broadcaster, id) {\n const predictions = await this.getPredictionsByIds(broadcaster, [id]);\n return predictions.length ? predictions[0] : null;\n }\n /**\n * Creates a new prediction.\n *\n * @param broadcaster The broadcaster to create the prediction for.\n * @param data\n *\n * @expandParams\n */\n async createPrediction(broadcaster, data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'predictions',\n method: 'POST',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:predictions'],\n jsonBody: createPredictionBody(broadcaster, data),\n });\n return new HelixPrediction(result.data[0], this._client);\n }\n /**\n * Locks a prediction.\n *\n * @param broadcaster The broadcaster to lock the prediction for.\n * @param id The ID of the prediction to lock.\n */\n async lockPrediction(broadcaster, id) {\n return await this._endPrediction(broadcaster, id, 'LOCKED');\n }\n /**\n * Resolves a prediction.\n *\n * @param broadcaster The broadcaster to resolve the prediction for.\n * @param id The ID of the prediction to resolve.\n * @param outcomeId The ID of the winning outcome.\n */\n async resolvePrediction(broadcaster, id, outcomeId) {\n return await this._endPrediction(broadcaster, id, 'RESOLVED', outcomeId);\n }\n /**\n * Cancels a prediction.\n *\n * @param broadcaster The broadcaster to cancel the prediction for.\n * @param id The ID of the prediction to cancel.\n */\n async cancelPrediction(broadcaster, id) {\n return await this._endPrediction(broadcaster, id, 'CANCELED');\n }\n async _endPrediction(broadcaster, id, status, outcomeId) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'predictions',\n method: 'PATCH',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:predictions'],\n jsonBody: createEndPredictionBody(broadcaster, id, status, outcomeId),\n });\n return new HelixPrediction(result.data[0], this._client);\n }\n};\nHelixPredictionApi = __decorate([\n rtfm('api', 'HelixPredictionApi')\n], HelixPredictionApi);\nexport { HelixPredictionApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createRaidStartQuery(from, to) {\n return {\n from_broadcaster_id: extractUserId(from),\n to_broadcaster_id: extractUserId(to),\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A result of a successful raid initiation.\n */\nlet HelixRaid = class HelixRaid extends DataObject {\n /**\n * The date when the raid was initiated.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * Whether the raid target channel is intended for mature audiences.\n */\n get targetIsMature() {\n return this[rawDataSymbol].is_mature;\n }\n};\nHelixRaid = __decorate([\n rtfm('api', 'HelixRaid')\n], HelixRaid);\nexport { HelixRaid };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createRaidStartQuery } from '../../interfaces/endpoints/raid.external.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixRaid } from './HelixRaid.js';\n/**\n * The Helix API methods that deal with raids.\n *\n * Can be accessed using `client.raids` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const raid = await api.raids.startRaid('125328655', '61369223');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Raids\n */\nlet HelixRaidApi = class HelixRaidApi extends BaseApi {\n /**\n * Initiate a raid from a live broadcaster to another live broadcaster.\n *\n * @param from The raiding broadcaster.\n * @param to The raid target.\n */\n async startRaid(from, to) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'raids',\n method: 'POST',\n userId: extractUserId(from),\n scopes: ['channel:manage:raids'],\n query: createRaidStartQuery(from, to),\n });\n return new HelixRaid(result.data[0]);\n }\n /**\n * Cancels an initiated raid.\n *\n * @param from The raiding broadcaster.\n */\n async cancelRaid(from) {\n await this._client.callApi({\n type: 'helix',\n url: 'raids',\n method: 'DELETE',\n userId: extractUserId(from),\n scopes: ['channel:manage:raids'],\n query: createBroadcasterQuery(from),\n });\n }\n};\nHelixRaidApi = __decorate([\n rtfm('api', 'HelixRaidApi')\n], HelixRaidApi);\nexport { HelixRaidApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createScheduleQuery(broadcaster, filter) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n start_time: filter?.startDate,\n utc_offset: filter?.utcOffset?.toString(),\n };\n}\n/** @internal */\nexport function createScheduleSettingsUpdateQuery(broadcaster, settings) {\n if (settings.vacation) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n is_vacation_enabled: 'true',\n vacation_start_time: settings.vacation.startDate,\n vacation_end_time: settings.vacation.endDate,\n timezone: settings.vacation.timezone,\n };\n }\n return {\n broadcaster_id: extractUserId(broadcaster),\n is_vacation_enabled: 'false',\n };\n}\n/** @internal */\nexport function createScheduleSegmentBody(data) {\n return {\n start_time: data.startDate,\n timezone: data.timezone,\n is_recurring: data.isRecurring,\n duration: data.duration,\n category_id: data.categoryId,\n title: data.title,\n };\n}\n/** @internal */\nexport function createScheduleSegmentModifyQuery(broadcaster, segmentId) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n id: segmentId,\n };\n}\n/** @internal */\nexport function createScheduleSegmentUpdateBody(data) {\n return {\n start_time: data.startDate,\n timezone: data.timezone,\n is_canceled: data.isCanceled,\n duration: data.duration,\n category_id: data.categoryId,\n title: data.title,\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable, mapNullable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A segment of a schedule.\n */\nlet HelixScheduleSegment = class HelixScheduleSegment extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the segment.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The date when the segment starts.\n */\n get startDate() {\n return new Date(this[rawDataSymbol].start_time);\n }\n /**\n * The date when the segment ends.\n */\n get endDate() {\n return new Date(this[rawDataSymbol].end_time);\n }\n /**\n * The title of the segment.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The date up to which the segment is canceled.\n */\n get cancelEndDate() {\n return mapNullable(this[rawDataSymbol].canceled_until, v => new Date(v));\n }\n /**\n * The ID of the category the segment is scheduled for, or null if no category is specified.\n */\n get categoryId() {\n return this[rawDataSymbol].category?.id ?? null;\n }\n /**\n * The name of the category the segment is scheduled for, or null if no category is specified.\n */\n get categoryName() {\n return this[rawDataSymbol].category?.name ?? null;\n }\n /**\n * Gets more information about the category the segment is scheduled for, or null if no category is specified.\n */\n async getCategory() {\n const categoryId = this[rawDataSymbol].category?.id;\n return categoryId ? await this._client.games.getGameById(categoryId) : null;\n }\n /**\n * Whether the segment is recurring every week.\n */\n get isRecurring() {\n return this[rawDataSymbol].is_recurring;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixScheduleSegment.prototype, \"_client\", void 0);\nHelixScheduleSegment = __decorate([\n rtfm('api', 'HelixScheduleSegment', 'id')\n], HelixScheduleSegment);\nexport { HelixScheduleSegment };\n", "import { __decorate } from \"tslib\";\nimport { rtfm } from '@twurple/common';\nimport { createScheduleQuery, } from '../../interfaces/endpoints/schedule.external.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { HelixScheduleSegment } from './HelixScheduleSegment.js';\n/**\n * A paginator specifically for schedule segments.\n */\nlet HelixPaginatedScheduleSegmentRequest = class HelixPaginatedScheduleSegmentRequest extends HelixPaginatedRequest {\n /** @internal */\n constructor(broadcaster, client, filter) {\n super({\n url: 'schedule',\n query: createScheduleQuery(broadcaster, filter),\n }, client, data => new HelixScheduleSegment(data, client), 25);\n }\n // sadly, this hack is necessary to work around the weird data model of schedules\n // while still keeping the pagination code as generic as possible\n /** @internal */\n async _fetchData(additionalOptions = {}) {\n const origData = (await super._fetchData(additionalOptions));\n return {\n data: origData.data.segments ?? [],\n pagination: origData.pagination,\n };\n }\n};\nHelixPaginatedScheduleSegmentRequest = __decorate([\n rtfm('api', 'HelixPaginatedScheduleSegmentRequest')\n], HelixPaginatedScheduleSegmentRequest);\nexport { HelixPaginatedScheduleSegmentRequest };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixScheduleSegment } from './HelixScheduleSegment.js';\n/**\n * A schedule of a channel.\n */\nlet HelixSchedule = class HelixSchedule extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The segments of the schedule.\n */\n get segments() {\n return this[rawDataSymbol].segments?.map(data => new HelixScheduleSegment(data, this._client)) ?? [];\n }\n /**\n * The ID of the broadcaster.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the broadcaster.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The date when the current vacation started, or null if the schedule is not in vacation mode.\n */\n get vacationStartDate() {\n const timestamp = this[rawDataSymbol].vacation?.start_time;\n return timestamp ? new Date(timestamp) : null;\n }\n /**\n * The date when the current vacation ends, or null if the schedule is not in vacation mode.\n */\n get vacationEndDate() {\n const timestamp = this[rawDataSymbol].vacation?.end_time;\n return timestamp ? new Date(timestamp) : null;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixSchedule.prototype, \"_client\", void 0);\nHelixSchedule = __decorate([\n rtfm('api', 'HelixSchedule', 'broadcasterId')\n], HelixSchedule);\nexport { HelixSchedule };\n", "import { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId } from '@twurple/common';\nimport { createGetByIdsQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { createScheduleQuery, createScheduleSegmentBody, createScheduleSegmentModifyQuery, createScheduleSegmentUpdateBody, createScheduleSettingsUpdateQuery, } from '../../interfaces/endpoints/schedule.external.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixPaginatedScheduleSegmentRequest } from './HelixPaginatedScheduleSegmentRequest.js';\nimport { HelixSchedule } from './HelixSchedule.js';\nimport { HelixScheduleSegment } from './HelixScheduleSegment.js';\n/**\n * The Helix API methods that deal with schedules.\n *\n * Can be accessed using `client.schedule` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const { data: schedule } = await api.helix.schedule.getSchedule('61369223');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Schedule\n */\nexport class HelixScheduleApi extends BaseApi {\n /**\n * Gets the schedule for a given broadcaster.\n *\n * @param broadcaster The broadcaster to get the schedule of.\n * @param filter\n *\n * @expandParams\n */\n async getSchedule(broadcaster, filter) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'schedule',\n userId: extractUserId(broadcaster),\n query: {\n ...createScheduleQuery(broadcaster, filter),\n ...createPaginationQuery(filter),\n },\n });\n return {\n data: new HelixSchedule(result.data, this._client),\n cursor: result.pagination.cursor,\n };\n }\n /**\n * Creates a paginator for schedule segments for a given broadcaster.\n *\n * @param broadcaster The broadcaster to get the schedule segments of.\n * @param filter\n *\n * @expandParams\n */\n getScheduleSegmentsPaginated(broadcaster, filter) {\n return new HelixPaginatedScheduleSegmentRequest(broadcaster, this._client, filter);\n }\n /**\n * Gets a set of schedule segments by IDs.\n *\n * @param broadcaster The broadcaster to get schedule segments of.\n * @param ids The IDs of the schedule segments.\n */\n async getScheduleSegmentsByIds(broadcaster, ids) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'schedule',\n userId: extractUserId(broadcaster),\n query: createGetByIdsQuery(broadcaster, ids),\n });\n return result.data.segments?.map(data => new HelixScheduleSegment(data, this._client)) ?? [];\n }\n /**\n * Gets a single schedule segment by ID.\n *\n * @param broadcaster The broadcaster to get a schedule segment of.\n * @param id The ID of the schedule segment.\n */\n async getScheduleSegmentById(broadcaster, id) {\n const segments = await this.getScheduleSegmentsByIds(broadcaster, [id]);\n return segments.length ? segments[0] : null;\n }\n /**\n * Gets the schedule for a given broadcaster in iCal format.\n *\n * @param broadcaster The broadcaster to get the schedule for.\n */\n async getScheduleAsIcal(broadcaster) {\n return await this._client.callApi({\n type: 'helix',\n url: 'schedule/icalendar',\n query: createBroadcasterQuery(broadcaster),\n });\n }\n /**\n * Updates the schedule settings of a given broadcaster.\n *\n * @param broadcaster The broadcaster to update the schedule settings for.\n * @param settings\n *\n * @expandParams\n */\n async updateScheduleSettings(broadcaster, settings) {\n await this._client.callApi({\n type: 'helix',\n url: 'schedule/settings',\n method: 'PATCH',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:schedule'],\n query: createScheduleSettingsUpdateQuery(broadcaster, settings),\n });\n }\n /**\n * Creates a new segment in a given broadcaster's schedule.\n *\n * @param broadcaster The broadcaster to create a new schedule segment for.\n * @param data\n *\n * @expandParams\n */\n async createScheduleSegment(broadcaster, data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'schedule/segment',\n method: 'POST',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:schedule'],\n query: createBroadcasterQuery(broadcaster),\n jsonBody: createScheduleSegmentBody(data),\n });\n return new HelixScheduleSegment(result.data.segments[0], this._client);\n }\n /**\n * Updates a segment in a given broadcaster's schedule.\n *\n * @param broadcaster The broadcaster to create a new schedule segment for.\n * @param segmentId The ID of the segment to update.\n * @param data\n *\n * @expandParams\n */\n async updateScheduleSegment(broadcaster, segmentId, data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'schedule/segment',\n method: 'PATCH',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:schedule'],\n query: createScheduleSegmentModifyQuery(broadcaster, segmentId),\n jsonBody: createScheduleSegmentUpdateBody(data),\n });\n return new HelixScheduleSegment(result.data.segments[0], this._client);\n }\n /**\n * Deletes a segment in a given broadcaster's schedule.\n *\n * @param broadcaster The broadcaster to create a new schedule segment for.\n * @param segmentId The ID of the segment to update.\n */\n async deleteScheduleSegment(broadcaster, segmentId) {\n await this._client.callApi({\n type: 'helix',\n url: 'schedule/segment',\n method: 'DELETE',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:schedule'],\n query: createScheduleSegmentModifyQuery(broadcaster, segmentId),\n });\n }\n}\n", "/** @internal */\nexport function createSearchChannelsQuery(query, filter) {\n return {\n query,\n live_only: filter.liveOnly?.toString(),\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * The result of a channel search.\n */\nlet HelixChannelSearchResult = class HelixChannelSearchResult extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The language of the channel.\n */\n get language() {\n return this[rawDataSymbol].broadcaster_language;\n }\n /**\n * The ID of the channel.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The name of the channel.\n */\n get name() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the channel.\n */\n get displayName() {\n return this[rawDataSymbol].display_name;\n }\n /**\n * Gets additional information about the owner of the channel.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].id));\n }\n /**\n * The ID of the game currently played on the channel.\n */\n get gameId() {\n return this[rawDataSymbol].game_id;\n }\n /**\n * The name of the game currently played on the channel.\n */\n get gameName() {\n return this[rawDataSymbol].game_name;\n }\n /**\n * Gets information about the game that is being played on the stream.\n */\n async getGame() {\n return this[rawDataSymbol].game_id\n ? checkRelationAssertion(await this._client.games.getGameById(this[rawDataSymbol].game_id))\n : null;\n }\n /**\n * Whether the channel is currently live.\n */\n get isLive() {\n return this[rawDataSymbol].is_live;\n }\n /**\n * The tags applied to the channel.\n */\n get tags() {\n return this[rawDataSymbol].tags;\n }\n /**\n * The thumbnail URL of the stream.\n */\n get thumbnailUrl() {\n return this[rawDataSymbol].thumbnail_url;\n }\n /**\n * The start date of the stream. Returns `null` if the stream is not live.\n */\n get startDate() {\n return this[rawDataSymbol].is_live ? new Date(this[rawDataSymbol].started_at) : null;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixChannelSearchResult.prototype, \"_client\", void 0);\nHelixChannelSearchResult = __decorate([\n rtfm('api', 'HelixChannelSearchResult', 'id')\n], HelixChannelSearchResult);\nexport { HelixChannelSearchResult };\n", "import { __decorate } from \"tslib\";\nimport { rtfm } from '@twurple/common';\nimport { createSearchChannelsQuery, } from '../../interfaces/endpoints/search.external.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixGame } from '../game/HelixGame.js';\nimport { HelixChannelSearchResult } from './HelixChannelSearchResult.js';\n/**\n * The Helix API methods that run searches.\n *\n * Can be accessed using `client.search` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const channels = await api.search.searchChannels('pear');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Search\n */\nlet HelixSearchApi = class HelixSearchApi extends BaseApi {\n /**\n * Search categories/games for an exact or partial match.\n *\n * @param query The search term.\n * @param pagination\n *\n * @expandParams\n */\n async searchCategories(query, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'search/categories',\n query: {\n query,\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResult(result, HelixGame, this._client);\n }\n /**\n * Creates a paginator for a category/game search.\n *\n * @param query The search term.\n */\n searchCategoriesPaginated(query) {\n return new HelixPaginatedRequest({\n url: 'search/categories',\n query: {\n query,\n },\n }, this._client, data => new HelixGame(data, this._client));\n }\n /**\n * Search channels for an exact or partial match.\n *\n * @param query The search term.\n * @param filter\n *\n * @expandParams\n */\n async searchChannels(query, filter = {}) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'search/channels',\n query: {\n ...createSearchChannelsQuery(query, filter),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixChannelSearchResult, this._client);\n }\n /**\n * Creates a paginator for a channel search.\n *\n * @param query The search term.\n * @param filter\n *\n * @expandParams\n */\n searchChannelsPaginated(query, filter = {}) {\n return new HelixPaginatedRequest({\n url: 'search/channels',\n query: createSearchChannelsQuery(query, filter),\n }, this._client, data => new HelixChannelSearchResult(data, this._client));\n }\n};\nHelixSearchApi = __decorate([\n rtfm('api', 'HelixSearchApi')\n], HelixSearchApi);\nexport { HelixSearchApi };\n", "import { CustomError } from '@twurple/common';\n/**\n * Thrown whenever you try something that requires your own stream to be live.\n */\nexport class StreamNotLiveError extends CustomError {\n /** @private */\n constructor(options) {\n super('Your stream needs to be live to do this', options);\n }\n}\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createStreamQuery(filter) {\n return {\n game_id: filter.game,\n language: filter.language,\n type: filter.type,\n user_id: filter.userId,\n user_login: filter.userName,\n };\n}\n/** @internal */\nexport function createStreamMarkerBody(broadcaster, description) {\n return {\n user_id: extractUserId(broadcaster),\n description,\n };\n}\n/** @internal */\nexport function createVideoQuery(id) {\n return {\n video_id: id,\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A Twitch stream.\n */\nlet HelixStream = class HelixStream extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The stream ID.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The user ID.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The user's name.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The user's display name.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets information about the user broadcasting the stream.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * The game ID, or an empty string if the stream doesn't currently have a game.\n */\n get gameId() {\n return this[rawDataSymbol].game_id;\n }\n /**\n * The game name, or an empty string if the stream doesn't currently have a game.\n */\n get gameName() {\n return this[rawDataSymbol].game_name;\n }\n /**\n * Gets information about the game that is being played on the stream.\n *\n * Returns null if the stream doesn't currently have a game.\n */\n async getGame() {\n return this[rawDataSymbol].game_id\n ? checkRelationAssertion(await this._client.games.getGameById(this[rawDataSymbol].game_id))\n : null;\n }\n /**\n * The type of the stream.\n */\n get type() {\n return this[rawDataSymbol].type;\n }\n /**\n * The title of the stream.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The number of viewers the stream currently has.\n */\n get viewers() {\n return this[rawDataSymbol].viewer_count;\n }\n /**\n * The time when the stream started.\n */\n get startDate() {\n return new Date(this[rawDataSymbol].started_at);\n }\n /**\n * The language of the stream.\n */\n get language() {\n return this[rawDataSymbol].language;\n }\n /**\n * The URL of the thumbnail of the stream.\n *\n * This URL includes the placeholders `{width}` and `{height}`\n * which you must replace with the desired dimensions of the thumbnail (in pixels).\n *\n * You can also use {@link HelixStream#getThumbnailUrl} to do this replacement.\n */\n get thumbnailUrl() {\n return this[rawDataSymbol].thumbnail_url;\n }\n /**\n * Builds the thumbnail URL of the stream using the given dimensions.\n *\n * @param width The width of the thumbnail.\n * @param height The height of the thumbnail.\n */\n getThumbnailUrl(width, height) {\n return this[rawDataSymbol].thumbnail_url\n .replace('{width}', width.toString())\n .replace('{height}', height.toString());\n }\n /**\n * The tags applied to the stream.\n */\n get tags() {\n return this[rawDataSymbol].tags;\n }\n /**\n * Whether the stream is set to be targeted to mature audiences only.\n */\n get isMature() {\n return this[rawDataSymbol].is_mature;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixStream.prototype, \"_client\", void 0);\nHelixStream = __decorate([\n rtfm('api', 'HelixStream', 'id')\n], HelixStream);\nexport { HelixStream };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A stream marker.\n */\nlet HelixStreamMarker = class HelixStreamMarker extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the marker.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The date and time when the marker was created.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The description of the marker.\n */\n get description() {\n return this[rawDataSymbol].description;\n }\n /**\n * The position in the stream when the marker was created, in seconds.\n */\n get positionInSeconds() {\n return this[rawDataSymbol].position_seconds;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixStreamMarker.prototype, \"_client\", void 0);\nHelixStreamMarker = __decorate([\n rtfm('api', 'HelixStreamMarker', 'id')\n], HelixStreamMarker);\nexport { HelixStreamMarker };\n", "import { __decorate } from \"tslib\";\nimport { checkRelationAssertion, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixStreamMarker } from './HelixStreamMarker.js';\n/**\n * A stream marker, also containing some video data.\n *\n * @inheritDoc\n */\nlet HelixStreamMarkerWithVideo = class HelixStreamMarkerWithVideo extends HelixStreamMarker {\n _videoId;\n /** @internal */\n constructor(data, _videoId, client) {\n super(data, client);\n this._videoId = _videoId;\n }\n /**\n * The URL of the video, which will start playing at the position of the stream marker.\n */\n get url() {\n return this[rawDataSymbol].URL;\n }\n /**\n * The ID of the video.\n */\n get videoId() {\n return this._videoId;\n }\n /**\n * Gets the video data of the video the marker was set in.\n */\n async getVideo() {\n return checkRelationAssertion(await this._client.videos.getVideoById(this._videoId));\n }\n};\nHelixStreamMarkerWithVideo = __decorate([\n rtfm('api', 'HelixStreamMarkerWithVideo', 'id')\n], HelixStreamMarkerWithVideo);\nexport { HelixStreamMarkerWithVideo };\n", "var HelixStreamApi_1;\nimport { __decorate } from \"tslib\";\nimport { Enumerable, flatten, mapNullable } from '@d-fischer/shared-utils';\nimport { createBroadcasterQuery, HttpStatusCodeError, } from '@twurple/api-call';\nimport { extractUserId, extractUserName, rtfm } from '@twurple/common';\nimport { StreamNotLiveError } from '../../errors/StreamNotLiveError.js';\nimport { createSingleKeyQuery, createUserQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { createStreamMarkerBody, createStreamQuery, createVideoQuery, } from '../../interfaces/endpoints/stream.external.js';\nimport { HelixRequestBatcher } from '../../utils/HelixRequestBatcher.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery, } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixStream } from './HelixStream.js';\nimport { HelixStreamMarker } from './HelixStreamMarker.js';\nimport { HelixStreamMarkerWithVideo } from './HelixStreamMarkerWithVideo.js';\n/**\n * The Helix API methods that deal with streams.\n *\n * Can be accessed using `client.streams` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const stream = await api.streams.getStreamByUserId('125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Streams\n */\nlet HelixStreamApi = HelixStreamApi_1 = class HelixStreamApi extends BaseApi {\n /** @internal */\n _getStreamByUserIdBatcher = new HelixRequestBatcher({\n url: 'streams',\n }, 'user_id', 'user_id', this._client, (data) => new HelixStream(data, this._client));\n /** @internal */\n _getStreamByUserNameBatcher = new HelixRequestBatcher({\n url: 'streams',\n }, 'user_login', 'user_login', this._client, (data) => new HelixStream(data, this._client));\n /**\n * Gets a list of streams.\n *\n * @param filter\n * @expandParams\n */\n async getStreams(filter = {}) {\n const result = await this._client.callApi({\n url: 'streams',\n type: 'helix',\n query: {\n ...createStreamQuery(filter),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixStream, this._client);\n }\n /**\n * Creates a paginator for streams.\n *\n * @param filter\n * @expandParams\n */\n getStreamsPaginated(filter = {}) {\n return new HelixPaginatedRequest({\n url: 'streams',\n query: createStreamQuery(filter),\n }, this._client, data => new HelixStream(data, this._client));\n }\n /**\n * Gets the current streams for the given usernames.\n *\n * @param users The username to get the streams for.\n */\n async getStreamsByUserNames(users) {\n const result = await this.getStreams({ userName: users.map(extractUserName) });\n return result.data;\n }\n /**\n * Gets the current stream for the given username.\n *\n * @param user The username to get the stream for.\n */\n async getStreamByUserName(user) {\n const result = await this.getStreamsByUserNames([user]);\n return result[0] ?? null;\n }\n /**\n * Gets the current stream for the given username, batching multiple calls into fewer requests as the API allows.\n *\n * @param user The username to get the stream for.\n */\n async getStreamByUserNameBatched(user) {\n return await this._getStreamByUserNameBatcher.request(extractUserName(user));\n }\n /**\n * Gets the current streams for the given user IDs.\n *\n * @param users The user IDs to get the streams for.\n */\n async getStreamsByUserIds(users) {\n const result = await this.getStreams({ userId: users.map(extractUserId) });\n return result.data;\n }\n /**\n * Gets the current stream for the given user ID.\n *\n * @param user The user ID to get the stream for.\n */\n async getStreamByUserId(user) {\n const userId = extractUserId(user);\n const result = await this._client.callApi({\n url: 'streams',\n type: 'helix',\n userId,\n query: createStreamQuery({ userId }),\n });\n return mapNullable(result.data[0], data => new HelixStream(data, this._client));\n }\n /**\n * Gets the current stream for the given user ID, batching multiple calls into fewer requests as the API allows.\n *\n * @param user The user ID to get the stream for.\n */\n async getStreamByUserIdBatched(user) {\n return await this._getStreamByUserIdBatcher.request(extractUserId(user));\n }\n /**\n * Gets a list of all stream markers for a user.\n *\n * @param user The user to list the stream markers for.\n * @param pagination\n *\n * @expandParams\n */\n async getStreamMarkersForUser(user, pagination) {\n const result = await this._client.callApi({\n url: 'streams/markers',\n type: 'helix',\n query: {\n ...createUserQuery(user),\n ...createPaginationQuery(pagination),\n },\n userId: extractUserId(user),\n scopes: ['user:read:broadcast'],\n canOverrideScopedUserContext: true,\n });\n return {\n data: flatten(result.data.map(data => HelixStreamApi_1._mapGetStreamMarkersResult(data, this._client))),\n cursor: result.pagination?.cursor,\n };\n }\n /**\n * Creates a paginator for all stream markers for a user.\n *\n * @param user The user to list the stream markers for.\n */\n getStreamMarkersForUserPaginated(user) {\n return new HelixPaginatedRequest({\n url: 'streams/markers',\n query: createUserQuery(user),\n userId: extractUserId(user),\n scopes: ['user:read:broadcast'],\n canOverrideScopedUserContext: true,\n }, this._client, data => HelixStreamApi_1._mapGetStreamMarkersResult(data, this._client));\n }\n /**\n * Gets a list of all stream markers for a video.\n *\n * @param user The user the video belongs to.\n * @param videoId The video to list the stream markers for.\n * @param pagination\n *\n * @expandParams\n */\n async getStreamMarkersForVideo(user, videoId, pagination) {\n const result = await this._client.callApi({\n url: 'streams/markers',\n type: 'helix',\n query: {\n ...createVideoQuery(videoId),\n ...createPaginationQuery(pagination),\n },\n userId: extractUserId(user),\n scopes: ['user:read:broadcast'],\n canOverrideScopedUserContext: true,\n });\n return {\n data: flatten(result.data.map(data => HelixStreamApi_1._mapGetStreamMarkersResult(data, this._client))),\n cursor: result.pagination?.cursor,\n };\n }\n /**\n * Creates a paginator for all stream markers for a video.\n *\n * @param user The user the video belongs to.\n * @param videoId The video to list the stream markers for.\n */\n getStreamMarkersForVideoPaginated(user, videoId) {\n return new HelixPaginatedRequest({\n url: 'streams/markers',\n query: createVideoQuery(videoId),\n userId: extractUserId(user),\n scopes: ['user:read:broadcast'],\n canOverrideScopedUserContext: true,\n }, this._client, data => HelixStreamApi_1._mapGetStreamMarkersResult(data, this._client));\n }\n /**\n * Creates a new stream marker.\n *\n * Only works while the specified user's stream is live.\n *\n * @param broadcaster The broadcaster to create a stream marker for.\n * @param description The description of the marker.\n */\n async createStreamMarker(broadcaster, description) {\n try {\n const result = await this._client.callApi({\n url: 'streams/markers',\n method: 'POST',\n type: 'helix',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:broadcast'],\n canOverrideScopedUserContext: true,\n jsonBody: createStreamMarkerBody(broadcaster, description),\n });\n return new HelixStreamMarker(result.data[0], this._client);\n }\n catch (e) {\n if (e instanceof HttpStatusCodeError && e.statusCode === 404) {\n throw new StreamNotLiveError({ cause: e });\n }\n throw e;\n }\n }\n /**\n * Gets the stream key of a stream.\n *\n * @param broadcaster The broadcaster to get the stream key for.\n */\n async getStreamKey(broadcaster) {\n const userId = extractUserId(broadcaster);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'streams/key',\n userId,\n scopes: ['channel:read:stream_key'],\n query: createBroadcasterQuery(broadcaster),\n });\n return result.data[0].stream_key;\n }\n /**\n * Gets the streams that are currently live and are followed by the given user.\n *\n * @param user The user to check followed streams for.\n * @param pagination\n *\n * @expandParams\n */\n async getFollowedStreams(user, pagination) {\n const userId = extractUserId(user);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'streams/followed',\n userId,\n scopes: ['user:read:follows'],\n query: {\n ...createSingleKeyQuery('user_id', userId),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResult(result, HelixStream, this._client);\n }\n /**\n * Creates a paginator for the streams that are currently live and are followed by the given user.\n *\n * @param user The user to check followed streams for.\n */\n getFollowedStreamsPaginated(user) {\n const userId = extractUserId(user);\n return new HelixPaginatedRequest({\n url: 'streams/followed',\n userId,\n scopes: ['user:read:follows'],\n query: createSingleKeyQuery('user_id', userId),\n }, this._client, data => new HelixStream(data, this._client));\n }\n static _mapGetStreamMarkersResult(data, client) {\n return data.videos.reduce((result, video) => [\n ...result,\n ...video.markers.map(marker => new HelixStreamMarkerWithVideo(marker, video.video_id, client)),\n ], []);\n }\n};\n__decorate([\n Enumerable(false)\n], HelixStreamApi.prototype, \"_getStreamByUserIdBatcher\", void 0);\n__decorate([\n Enumerable(false)\n], HelixStreamApi.prototype, \"_getStreamByUserNameBatcher\", void 0);\nHelixStreamApi = HelixStreamApi_1 = __decorate([\n rtfm('api', 'HelixStreamApi')\n], HelixStreamApi);\nexport { HelixStreamApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createSubscriptionCheckQuery(broadcaster, user) {\n return {\n broadcaster_id: extractUserId(broadcaster),\n user_id: extractUserId(user),\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * The user info about a (paid) subscription to a broadcaster.\n */\nlet HelixUserSubscription = class HelixUserSubscription extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The user ID of the broadcaster.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the broadcaster.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the broadcaster.\n */\n async getBroadcaster() {\n return await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id);\n }\n /**\n * Whether the subscription has been gifted by another user.\n */\n get isGift() {\n return this[rawDataSymbol].is_gift;\n }\n /**\n * The tier of the subscription.\n */\n get tier() {\n return this[rawDataSymbol].tier;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixUserSubscription.prototype, \"_client\", void 0);\nHelixUserSubscription = __decorate([\n rtfm('api', 'HelixUserSubscription', 'broadcasterId')\n], HelixUserSubscription);\nexport { HelixUserSubscription };\n", "import { __decorate } from \"tslib\";\nimport { checkRelationAssertion, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixUserSubscription } from './HelixUserSubscription.js';\n/**\n * A (paid) subscription of a user to a broadcaster.\n *\n * @inheritDoc\n */\nlet HelixSubscription = class HelixSubscription extends HelixUserSubscription {\n /**\n * The user ID of the broadcaster.\n */\n get broadcasterId() {\n return this[rawDataSymbol].broadcaster_id;\n }\n /**\n * The name of the broadcaster.\n */\n get broadcasterName() {\n return this[rawDataSymbol].broadcaster_login;\n }\n /**\n * The display name of the broadcaster.\n */\n get broadcasterDisplayName() {\n return this[rawDataSymbol].broadcaster_name;\n }\n /**\n * Gets more information about the broadcaster.\n */\n async getBroadcaster() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].broadcaster_id));\n }\n /**\n * The user ID of the gifter.\n */\n get gifterId() {\n return this[rawDataSymbol].is_gift ? this[rawDataSymbol].gifter_id : null;\n }\n /**\n * The name of the gifter.\n */\n get gifterName() {\n return this[rawDataSymbol].is_gift ? this[rawDataSymbol].gifter_login : null;\n }\n /**\n * The display name of the gifter.\n */\n get gifterDisplayName() {\n return this[rawDataSymbol].is_gift ? this[rawDataSymbol].gifter_name : null;\n }\n /**\n * Gets more information about the gifter.\n */\n async getGifter() {\n return this[rawDataSymbol].is_gift\n ? checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].gifter_id))\n : null;\n }\n /**\n * The user ID of the subscribed user.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the subscribed user.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the subscribed user.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets more information about the subscribed user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n};\nHelixSubscription = __decorate([\n rtfm('api', 'HelixSubscription', 'userId')\n], HelixSubscription);\nexport { HelixSubscription };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { HelixPaginatedRequestWithTotal } from '../../utils/pagination/HelixPaginatedRequestWithTotal.js';\nimport { HelixSubscription } from './HelixSubscription.js';\n/**\n * A special case of {@link HelixPaginatedRequestWithTotal}\n * with support for fetching the total sub points of a broadcaster.\n *\n * @inheritDoc\n */\nlet HelixPaginatedSubscriptionsRequest = class HelixPaginatedSubscriptionsRequest extends HelixPaginatedRequestWithTotal {\n /** @internal */\n constructor(broadcaster, client) {\n super({\n url: 'subscriptions',\n scopes: ['channel:read:subscriptions'],\n userId: extractUserId(broadcaster),\n query: createBroadcasterQuery(broadcaster),\n }, client, data => new HelixSubscription(data, client));\n }\n /**\n * Gets the total sub points of the broadcaster.\n */\n async getPoints() {\n const data = this._currentData ??\n (await this._fetchData({ query: { after: undefined } }));\n return data.points;\n }\n};\nHelixPaginatedSubscriptionsRequest = __decorate([\n rtfm('api', 'HelixPaginatedSubscriptionsRequest')\n], HelixPaginatedSubscriptionsRequest);\nexport { HelixPaginatedSubscriptionsRequest };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery, HttpStatusCodeError } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createChannelUsersCheckQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { createSubscriptionCheckQuery, } from '../../interfaces/endpoints/subscription.external.js';\nimport { createPaginatedResultWithTotal } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixPaginatedSubscriptionsRequest } from './HelixPaginatedSubscriptionsRequest.js';\nimport { HelixSubscription } from './HelixSubscription.js';\nimport { HelixUserSubscription } from './HelixUserSubscription.js';\n/**\n * The Helix API methods that deal with subscriptions.\n *\n * Can be accessed using `client.subscriptions` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const subscription = await api.subscriptions.getSubscriptionForUser('61369223', '125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Subscriptions\n */\nlet HelixSubscriptionApi = class HelixSubscriptionApi extends BaseApi {\n /**\n * Gets a list of all subscriptions to a given broadcaster.\n *\n * @param broadcaster The broadcaster to list subscriptions to.\n * @param pagination\n *\n * @expandParams\n */\n async getSubscriptions(broadcaster, pagination) {\n const result = await this._client.callApi({\n url: 'subscriptions',\n scopes: ['channel:read:subscriptions'],\n type: 'helix',\n userId: extractUserId(broadcaster),\n query: {\n ...createBroadcasterQuery(broadcaster),\n ...createPaginationQuery(pagination),\n },\n });\n return {\n ...createPaginatedResultWithTotal(result, HelixSubscription, this._client),\n points: result.points,\n };\n }\n /**\n * Creates a paginator for all subscriptions to a given broadcaster.\n *\n * @param broadcaster The broadcaster to list subscriptions to.\n */\n getSubscriptionsPaginated(broadcaster) {\n return new HelixPaginatedSubscriptionsRequest(broadcaster, this._client);\n }\n /**\n * Gets the subset of the given user list that is subscribed to the given broadcaster.\n *\n * @param broadcaster The broadcaster to find subscriptions to.\n * @param users The users that should be checked for subscriptions.\n */\n async getSubscriptionsForUsers(broadcaster, users) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'subscriptions',\n userId: extractUserId(broadcaster),\n scopes: ['channel:read:subscriptions'],\n query: createChannelUsersCheckQuery(broadcaster, users),\n });\n return result.data.map(data => new HelixSubscription(data, this._client));\n }\n /**\n * Gets the subscription data for a given user to a given broadcaster.\n *\n * This checks with the authorization of a broadcaster.\n * If you only have the authorization of a user, check {@link HelixSubscriptionApi#checkUserSubscription}}.\n *\n * @param broadcaster The broadcaster to check.\n * @param user The user to check.\n */\n async getSubscriptionForUser(broadcaster, user) {\n const list = await this.getSubscriptionsForUsers(broadcaster, [user]);\n return list.length ? list[0] : null;\n }\n /**\n * Checks if a given user is subscribed to a given broadcaster. Returns null if not subscribed.\n *\n * This checks with the authorization of a user.\n * If you only have the authorization of a broadcaster, check {@link HelixSubscriptionApi#getSubscriptionForUser}}.\n *\n * @param user The user to check.\n * @param broadcaster The broadcaster to check the user's subscription for.\n */\n async checkUserSubscription(user, broadcaster) {\n try {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'subscriptions/user',\n userId: extractUserId(user),\n scopes: ['user:read:subscriptions'],\n query: createSubscriptionCheckQuery(broadcaster, user),\n });\n return new HelixUserSubscription(result.data[0], this._client);\n }\n catch (e) {\n if (e instanceof HttpStatusCodeError && e.statusCode === 404) {\n return null;\n }\n throw e;\n }\n }\n};\nHelixSubscriptionApi = __decorate([\n rtfm('api', 'HelixSubscriptionApi')\n], HelixSubscriptionApi);\nexport { HelixSubscriptionApi };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A Stream Team.\n */\nlet HelixTeam = class HelixTeam extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the team.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The name of the team.\n */\n get name() {\n return this[rawDataSymbol].team_name;\n }\n /**\n * The display name of the team.\n */\n get displayName() {\n return this[rawDataSymbol].team_display_name;\n }\n /**\n * The URL of the background image of the team.\n */\n get backgroundImageUrl() {\n return this[rawDataSymbol].background_image_url;\n }\n /**\n * The URL of the banner of the team.\n */\n get bannerUrl() {\n return this[rawDataSymbol].banner;\n }\n /**\n * The date when the team was created.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The date when the team was last updated.\n */\n get updateDate() {\n return new Date(this[rawDataSymbol].updated_at);\n }\n /**\n * The info of the team.\n *\n * May contain HTML tags.\n */\n get info() {\n return this[rawDataSymbol].info;\n }\n /**\n * The URL of the thumbnail of the team's logo.\n */\n get logoThumbnailUrl() {\n return this[rawDataSymbol].thumbnail_url;\n }\n /**\n * Gets the relations to the members of the team.\n */\n async getUserRelations() {\n const teamWithUsers = await this._client.teams.getTeamById(this.id);\n return teamWithUsers.userRelations;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixTeam.prototype, \"_client\", void 0);\nHelixTeam = __decorate([\n rtfm('api', 'HelixTeam', 'id')\n], HelixTeam);\nexport { HelixTeam };\n", "import { __decorate } from \"tslib\";\nimport { rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixUserRelation } from '../../relations/HelixUserRelation.js';\nimport { HelixTeam } from './HelixTeam.js';\n/**\n * A Stream Team with its member relations.\n *\n * @inheritDoc\n */\nlet HelixTeamWithUsers = class HelixTeamWithUsers extends HelixTeam {\n /**\n * The relations to the members of the team.\n */\n get userRelations() {\n return this[rawDataSymbol].users.map(data => new HelixUserRelation(data, this._client));\n }\n};\nHelixTeamWithUsers = __decorate([\n rtfm('api', 'HelixTeamWithUsers', 'id')\n], HelixTeamWithUsers);\nexport { HelixTeamWithUsers };\n", "import { __decorate } from \"tslib\";\nimport { createBroadcasterQuery, HttpStatusCodeError } from '@twurple/api-call';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixTeam } from './HelixTeam.js';\nimport { HelixTeamWithUsers } from './HelixTeamWithUsers.js';\n/**\n * The Helix API methods that deal with teams.\n *\n * Can be accessed using `client.teams` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const tags = await api.teams.getChannelTeams('125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Teams\n */\nlet HelixTeamApi = class HelixTeamApi extends BaseApi {\n /**\n * Gets a list of all teams a broadcaster is a member of.\n *\n * @param broadcaster The broadcaster to get the teams of.\n */\n async getTeamsForBroadcaster(broadcaster) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'teams/channel',\n userId: extractUserId(broadcaster),\n query: createBroadcasterQuery(broadcaster),\n });\n return result.data?.map(data => new HelixTeam(data, this._client)) ?? [];\n }\n /**\n * Gets a team by ID.\n *\n * Returns null if there is no team with the given ID.\n *\n * @param id The ID of the team.\n */\n async getTeamById(id) {\n try {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'teams',\n query: {\n id,\n },\n });\n return new HelixTeamWithUsers(result.data[0], this._client);\n }\n catch (e) {\n // Twitch, please...\n if (e instanceof HttpStatusCodeError && e.statusCode === 500) {\n return null;\n }\n throw e;\n }\n }\n /**\n * Gets a team by name.\n *\n * Returns null if there is no team with the given name.\n *\n * @param name The name of the team.\n */\n async getTeamByName(name) {\n try {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'teams',\n query: {\n name,\n },\n });\n return new HelixTeamWithUsers(result.data[0], this._client);\n }\n catch (e) {\n // ...but this one is fine\n if (e instanceof HttpStatusCodeError && e.statusCode === 404) {\n return null;\n }\n throw e;\n }\n }\n};\nHelixTeamApi = __decorate([\n rtfm('api', 'HelixTeamApi')\n], HelixTeamApi);\nexport { HelixTeamApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createUserBlockCreateQuery(target, additionalInfo) {\n return {\n target_user_id: extractUserId(target),\n source_context: additionalInfo.sourceContext,\n reason: additionalInfo.reason,\n };\n}\n/** @internal */\nexport function createUserBlockDeleteQuery(target) {\n return {\n target_user_id: extractUserId(target),\n };\n}\n", "import { DataObject, rawDataSymbol } from '@twurple/common';\n/** @protected */\nexport class HelixBaseExtension extends DataObject {\n /**\n * The ID of the extension.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The version of the extension.\n */\n get version() {\n return this[rawDataSymbol].version;\n }\n /**\n * The name of the extension.\n */\n get name() {\n return this[rawDataSymbol].name;\n }\n}\n", "import { __decorate } from \"tslib\";\nimport { rtfm } from '@twurple/common';\nimport { HelixBaseExtension } from './HelixBaseExtension.js';\n/**\n * A Twitch Extension that is installed in a slot of a channel.\n *\n * @inheritDoc\n */\nlet HelixInstalledExtension = class HelixInstalledExtension extends HelixBaseExtension {\n _slotType;\n _slotId;\n /** @internal */\n constructor(slotType, slotId, data) {\n super(data);\n this._slotType = slotType;\n this._slotId = slotId;\n }\n /**\n * The type of the slot the extension is in.\n */\n get slotType() {\n return this._slotType;\n }\n /**\n * The ID of the slot the extension is in.\n */\n get slotId() {\n return this._slotId;\n }\n};\nHelixInstalledExtension = __decorate([\n rtfm('api', 'HelixInstalledExtension', 'id')\n], HelixInstalledExtension);\nexport { HelixInstalledExtension };\n", "import { __decorate } from \"tslib\";\nimport { DataObject, rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixInstalledExtension } from './HelixInstalledExtension.js';\n/**\n * A list of extensions installed in a channel.\n */\nlet HelixInstalledExtensionList = class HelixInstalledExtensionList extends DataObject {\n getExtensionAtSlot(type, slotId) {\n const data = this[rawDataSymbol][type][slotId];\n return data.active ? new HelixInstalledExtension(type, slotId, data) : null;\n }\n getExtensionsForSlotType(type) {\n return [...Object.entries(this[rawDataSymbol][type])]\n .filter((entry) => entry[1].active)\n .map(([slotId, slotData]) => new HelixInstalledExtension(type, slotId, slotData));\n }\n getAllExtensions() {\n return [...Object.entries(this[rawDataSymbol])].flatMap(([type, typeEntries]) => [...Object.entries(typeEntries)]\n .filter((entry) => entry[1].active)\n .map(([slotId, slotData]) => new HelixInstalledExtension(type, slotId, slotData)));\n }\n};\nHelixInstalledExtensionList = __decorate([\n rtfm('api', 'HelixInstalledExtensionList')\n], HelixInstalledExtensionList);\nexport { HelixInstalledExtensionList };\n", "import { __decorate } from \"tslib\";\nimport { rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixBaseExtension } from './HelixBaseExtension.js';\n/**\n * A Twitch Extension that was installed by a user.\n *\n * @inheritDoc\n */\nlet HelixUserExtension = class HelixUserExtension extends HelixBaseExtension {\n /**\n * Whether the user has configured the extension to be able to activate it.\n */\n get canActivate() {\n return this[rawDataSymbol].can_activate;\n }\n /**\n * The available types of the extension.\n */\n get types() {\n return this[rawDataSymbol].type;\n }\n};\nHelixUserExtension = __decorate([\n rtfm('api', 'HelixUserExtension', 'id')\n], HelixUserExtension);\nexport { HelixUserExtension };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { DataObject, rawDataSymbol, rtfm, } from '@twurple/common';\n/**\n * A Twitch user.\n */\nlet HelixUser = class HelixUser extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the user.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The name of the user.\n */\n get name() {\n return this[rawDataSymbol].login;\n }\n /**\n * The display name of the user.\n */\n get displayName() {\n return this[rawDataSymbol].display_name;\n }\n /**\n * The description of the user.\n */\n get description() {\n return this[rawDataSymbol].description;\n }\n /**\n * The type of the user.\n */\n get type() {\n return this[rawDataSymbol].type;\n }\n /**\n * The type of the broadcaster.\n */\n get broadcasterType() {\n return this[rawDataSymbol].broadcaster_type;\n }\n /**\n * The URL of the profile picture of the user.\n */\n get profilePictureUrl() {\n return this[rawDataSymbol].profile_image_url;\n }\n /**\n * The URL of the offline video placeholder of the user.\n */\n get offlinePlaceholderUrl() {\n return this[rawDataSymbol].offline_image_url;\n }\n /**\n * The date when the user was created, i.e. when they registered on Twitch.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * Gets the channel's stream data.\n */\n async getStream() {\n return await this._client.streams.getStreamByUserId(this);\n }\n /**\n * Gets a list of broadcasters the user follows.\n */\n async getFollowedChannels() {\n return await this._client.channels.getFollowedChannels(this);\n }\n /**\n * Gets the follow data of the user to the given broadcaster, or `null` if the user doesn't follow the broadcaster.\n *\n * This requires user authentication.\n * For broadcaster authentication, you can use `getChannelFollower` while switching `this` and the parameter.\n *\n * @param broadcaster The broadcaster to check the follow to.\n */\n async getFollowedChannel(broadcaster) {\n const result = await this._client.channels.getFollowedChannels(this, broadcaster);\n return result.data[0] ?? null;\n }\n /**\n * Checks whether the user is following the given broadcaster.\n *\n * This requires user authentication.\n * For broadcaster authentication, you can use `isFollowedBy` while switching `this` and the parameter.\n *\n * @param broadcaster The broadcaster to check the user's follow to.\n */\n async follows(broadcaster) {\n return (await this.getFollowedChannel(broadcaster)) !== null;\n }\n /**\n * Gets a list of users that follow the broadcaster.\n */\n async getChannelFollowers() {\n return await this._client.channels.getChannelFollowers(this);\n }\n /**\n * Gets the follow data of the given user to the broadcaster, or `null` if the user doesn't follow the broadcaster.\n *\n * This requires broadcaster authentication.\n * For user authentication, you can use `getFollowedChannel` while switching `this` and the parameter.\n *\n * @param user The user to check the follow from.\n */\n async getChannelFollower(user) {\n const result = await this._client.channels.getChannelFollowers(this, user);\n return result.data[0] ?? null;\n }\n /**\n * Checks whether the given user is following the broadcaster.\n *\n * This requires broadcaster authentication.\n * For user authentication, you can use `follows` while switching `this` and the parameter.\n *\n * @param user The user to check the broadcaster's follow from.\n */\n async isFollowedBy(user) {\n return (await this.getChannelFollower(user)) !== null;\n }\n /**\n * Gets the subscription data for the user to the given broadcaster, or `null` if the user is not subscribed.\n *\n * This requires user authentication.\n * For broadcaster authentication, you can use `getSubscriber` while switching `this` and the parameter.\n *\n * @param broadcaster The broadcaster you want to get the subscription data for.\n */\n async getSubscriptionTo(broadcaster) {\n return await this._client.subscriptions.checkUserSubscription(this, broadcaster);\n }\n /**\n * Checks whether the user is subscribed to the given broadcaster.\n *\n * This requires user authentication.\n * For broadcaster authentication, you can use `hasSubscriber` while switching `this` and the parameter.\n *\n * @param broadcaster The broadcaster you want to check the subscription for.\n */\n async isSubscribedTo(broadcaster) {\n return (await this.getSubscriptionTo(broadcaster)) !== null;\n }\n /**\n * Gets the subscription data for the given user to the broadcaster, or `null` if the user is not subscribed.\n *\n * This requires broadcaster authentication.\n * For user authentication, you can use `getSubscriptionTo` while switching `this` and the parameter.\n *\n * @param user The user you want to get the subscription data for.\n */\n async getSubscriber(user) {\n return await this._client.subscriptions.getSubscriptionForUser(this, user);\n }\n /**\n * Checks whether the given user is subscribed to the broadcaster.\n *\n * This requires broadcaster authentication.\n * For user authentication, you can use `isSubscribedTo` while switching `this` and the parameter.\n *\n * @param user The user you want to check the subscription for.\n */\n async hasSubscriber(user) {\n return (await this.getSubscriber(user)) !== null;\n }\n};\n__decorate([\n Enumerable(false)\n], HelixUser.prototype, \"_client\", void 0);\nHelixUser = __decorate([\n rtfm('api', 'HelixUser', 'id')\n], HelixUser);\nexport { HelixUser };\n", "import { __decorate } from \"tslib\";\nimport { rawDataSymbol, rtfm } from '@twurple/common';\nimport { HelixUser } from './HelixUser.js';\n/**\n * A user you have extended privilges for, i.e. yourself.\n *\n * @inheritDoc\n */\nlet HelixPrivilegedUser = class HelixPrivilegedUser extends HelixUser {\n /**\n * The email address of the user.\n */\n get email() {\n return this[rawDataSymbol].email;\n }\n /**\n * Changes the description of the user.\n *\n * @param description The new description.\n */\n async setDescription(description) {\n return await this._client.users.updateAuthenticatedUser(this, { description });\n }\n};\nHelixPrivilegedUser = __decorate([\n rtfm('api', 'HelixPrivilegedUser', 'id')\n], HelixPrivilegedUser);\nexport { HelixPrivilegedUser };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * An user blocked by a previously given user.\n */\nlet HelixUserBlock = class HelixUserBlock extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the blocked user.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the blocked user.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the blocked user.\n */\n get userDisplayName() {\n return this[rawDataSymbol].display_name;\n }\n /**\n * Gets additional information about the blocked user.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixUserBlock.prototype, \"_client\", void 0);\nHelixUserBlock = __decorate([\n rtfm('api', 'HelixUserBlock', 'userId')\n], HelixUserBlock);\nexport { HelixUserBlock };\n", "import { __decorate } from \"tslib\";\nimport { Enumerable, mapNullable } from '@d-fischer/shared-utils';\nimport { createBroadcasterQuery } from '@twurple/api-call';\nimport { extractUserId, extractUserName, HellFreezesOverError, rtfm, } from '@twurple/common';\nimport { createSingleKeyQuery } from '../../interfaces/endpoints/generic.external.js';\nimport { createUserBlockCreateQuery, createUserBlockDeleteQuery, } from '../../interfaces/endpoints/user.external.js';\nimport { HelixRequestBatcher } from '../../utils/HelixRequestBatcher.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixInstalledExtensionList } from './extensions/HelixInstalledExtensionList.js';\nimport { HelixUserExtension } from './extensions/HelixUserExtension.js';\nimport { HelixPrivilegedUser } from './HelixPrivilegedUser.js';\nimport { HelixUser } from './HelixUser.js';\nimport { HelixUserBlock } from './HelixUserBlock.js';\n/**\n * The Helix API methods that deal with users.\n *\n * Can be accessed using `client.users` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const user = await api.users.getUserById('125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Users\n */\nlet HelixUserApi = class HelixUserApi extends BaseApi {\n /** @internal */\n _getUserByIdBatcher = new HelixRequestBatcher({\n url: 'users',\n }, 'id', 'id', this._client, (data) => new HelixUser(data, this._client));\n /** @internal */\n _getUserByNameBatcher = new HelixRequestBatcher({\n url: 'users',\n }, 'login', 'login', this._client, (data) => new HelixUser(data, this._client));\n /**\n * Gets the user data for the given list of user IDs.\n *\n * @param userIds The user IDs you want to look up.\n */\n async getUsersByIds(userIds) {\n return await this._getUsers('id', userIds.map(extractUserId));\n }\n /**\n * Gets the user data for the given list of usernames.\n *\n * @param userNames The usernames you want to look up.\n */\n async getUsersByNames(userNames) {\n return await this._getUsers('login', userNames.map(extractUserName));\n }\n /**\n * Gets the user data for the given user ID.\n *\n * @param user The user ID you want to look up.\n */\n async getUserById(user) {\n const userId = extractUserId(user);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'users',\n userId,\n query: {\n id: userId,\n },\n });\n return mapNullable(result.data[0], data => new HelixUser(data, this._client));\n }\n /**\n * Gets the user data for the given user ID, batching multiple calls into fewer requests as the API allows.\n *\n * @param user The user ID you want to look up.\n */\n async getUserByIdBatched(user) {\n return await this._getUserByIdBatcher.request(extractUserId(user));\n }\n /**\n * Gets the user data for the given username.\n *\n * @param userName The username you want to look up.\n */\n async getUserByName(userName) {\n const users = await this._getUsers('login', [extractUserName(userName)]);\n return users.length ? users[0] : null;\n }\n /**\n * Gets the user data for the given username, batching multiple calls into fewer requests as the API allows.\n *\n * @param user The username you want to look up.\n */\n async getUserByNameBatched(user) {\n return await this._getUserByNameBatcher.request(extractUserName(user));\n }\n /**\n * Gets the user data of the given authenticated user.\n *\n * @param user The user to get data for.\n * @param withEmail Whether you need the user's email address.\n */\n async getAuthenticatedUser(user, withEmail = false) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'users',\n forceType: 'user',\n userId: extractUserId(user),\n scopes: withEmail ? ['user:read:email'] : undefined,\n });\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!result.data?.length) {\n throw new HellFreezesOverError('Could not get authenticated user');\n }\n return new HelixPrivilegedUser(result.data[0], this._client);\n }\n /**\n * Updates the given authenticated user's data.\n *\n * @param user The user to update.\n * @param data The data to update.\n */\n async updateAuthenticatedUser(user, data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'users',\n method: 'PUT',\n userId: extractUserId(user),\n scopes: ['user:edit'],\n query: {\n description: data.description,\n },\n });\n return new HelixPrivilegedUser(result.data[0], this._client);\n }\n /**\n * Gets a list of users blocked by the given user.\n *\n * @param user The user to get blocks for.\n * @param pagination\n *\n * @expandParams\n */\n async getBlocks(user, pagination) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'users/blocks',\n userId: extractUserId(user),\n scopes: ['user:read:blocked_users'],\n query: {\n ...createBroadcasterQuery(user),\n ...createPaginationQuery(pagination),\n },\n });\n return createPaginatedResult(result, HelixUserBlock, this._client);\n }\n /**\n * Creates a paginator for users blocked by the given user.\n *\n * @param user The user to get blocks for.\n */\n getBlocksPaginated(user) {\n return new HelixPaginatedRequest({\n url: 'users/blocks',\n userId: extractUserId(user),\n scopes: ['user:read:blocked_users'],\n query: createBroadcasterQuery(user),\n }, this._client, data => new HelixUserBlock(data, this._client));\n }\n /**\n * Blocks the given user.\n *\n * @param broadcaster The user to add the block to.\n * @param target The user to block.\n * @param additionalInfo Additional info to give context to the block.\n *\n * @expandParams\n */\n async createBlock(broadcaster, target, additionalInfo = {}) {\n await this._client.callApi({\n type: 'helix',\n url: 'users/blocks',\n method: 'PUT',\n userId: extractUserId(broadcaster),\n scopes: ['user:manage:blocked_users'],\n query: createUserBlockCreateQuery(target, additionalInfo),\n });\n }\n /**\n * Unblocks the given user.\n *\n * @param broadcaster The user to remove the block from.\n * @param target The user to unblock.\n */\n async deleteBlock(broadcaster, target) {\n await this._client.callApi({\n type: 'helix',\n url: 'users/blocks',\n method: 'DELETE',\n userId: extractUserId(broadcaster),\n scopes: ['user:manage:blocked_users'],\n query: createUserBlockDeleteQuery(target),\n });\n }\n /**\n * Gets a list of all extensions for the given authenticated user.\n *\n * @param broadcaster The broadcaster to get the list of extensions for.\n * @param withInactive Whether to include inactive extensions.\n */\n async getExtensionsForAuthenticatedUser(broadcaster, withInactive = false) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'users/extensions/list',\n userId: extractUserId(broadcaster),\n scopes: withInactive ? ['channel:manage:extensions'] : ['user:read:broadcast', 'channel:manage:extensions'],\n });\n return result.data.map(data => new HelixUserExtension(data));\n }\n /**\n * Gets a list of all installed extensions for the given user.\n *\n * @param user The user to get the installed extensions for.\n * @param withDev Whether to include extensions that are in development.\n */\n async getActiveExtensions(user, withDev = false) {\n const userId = extractUserId(user);\n const result = await this._client.callApi({\n type: 'helix',\n url: 'users/extensions',\n userId,\n scopes: withDev ? ['user:read:broadcast', 'channel:manage:extensions'] : undefined,\n query: createSingleKeyQuery('user_id', userId),\n });\n return new HelixInstalledExtensionList(result.data);\n }\n /**\n * Updates the installed extensions for the given authenticated user.\n *\n * @param broadcaster The user to update the installed extensions for.\n * @param data The extension installation payload.\n *\n * The format is shown on the [Twitch documentation](https://dev.twitch.tv/docs/api/reference#update-user-extensions).\n * Don't use the \"data\" wrapper though.\n */\n async updateActiveExtensionsForAuthenticatedUser(broadcaster, data) {\n const result = await this._client.callApi({\n type: 'helix',\n url: 'users/extensions',\n method: 'PUT',\n userId: extractUserId(broadcaster),\n scopes: ['channel:manage:extensions'],\n jsonBody: { data },\n });\n return new HelixInstalledExtensionList(result.data);\n }\n async _getUsers(lookupType, param) {\n if (param.length === 0) {\n return [];\n }\n const query = { [lookupType]: param };\n const result = await this._client.callApi({\n type: 'helix',\n url: 'users',\n query,\n });\n return result.data.map(userData => new HelixUser(userData, this._client));\n }\n};\n__decorate([\n Enumerable(false)\n], HelixUserApi.prototype, \"_getUserByIdBatcher\", void 0);\n__decorate([\n Enumerable(false)\n], HelixUserApi.prototype, \"_getUserByNameBatcher\", void 0);\nHelixUserApi = __decorate([\n rtfm('api', 'HelixUserApi')\n], HelixUserApi);\nexport { HelixUserApi };\n", "import { __decorate } from \"tslib\";\nimport { Cacheable, CachedGetter } from '@d-fischer/cache-decorators';\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { checkRelationAssertion, DataObject, HellFreezesOverError, rawDataSymbol, rtfm } from '@twurple/common';\n/**\n * A video on Twitch.\n */\nlet HelixVideo = class HelixVideo extends DataObject {\n /** @internal */ _client;\n /** @internal */\n constructor(data, client) {\n super(data);\n this._client = client;\n }\n /**\n * The ID of the video.\n */\n get id() {\n return this[rawDataSymbol].id;\n }\n /**\n * The ID of the user who created the video.\n */\n get userId() {\n return this[rawDataSymbol].user_id;\n }\n /**\n * The name of the user who created the video.\n */\n get userName() {\n return this[rawDataSymbol].user_login;\n }\n /**\n * The display name of the user who created the video.\n */\n get userDisplayName() {\n return this[rawDataSymbol].user_name;\n }\n /**\n * Gets information about the user who created the video.\n */\n async getUser() {\n return checkRelationAssertion(await this._client.users.getUserById(this[rawDataSymbol].user_id));\n }\n /**\n * The title of the video.\n */\n get title() {\n return this[rawDataSymbol].title;\n }\n /**\n * The description of the video.\n */\n get description() {\n return this[rawDataSymbol].description;\n }\n /**\n * The date when the video was created.\n */\n get creationDate() {\n return new Date(this[rawDataSymbol].created_at);\n }\n /**\n * The date when the video was published.\n */\n get publishDate() {\n return new Date(this[rawDataSymbol].published_at);\n }\n /**\n * The URL of the video.\n */\n get url() {\n return this[rawDataSymbol].url;\n }\n /**\n * The URL of the thumbnail of the video.\n */\n get thumbnailUrl() {\n return this[rawDataSymbol].thumbnail_url;\n }\n /**\n * Builds the thumbnail URL of the video using the given dimensions.\n *\n * @param width The width of the thumbnail.\n * @param height The height of the thumbnail.\n */\n getThumbnailUrl(width, height) {\n return this[rawDataSymbol].thumbnail_url\n .replace('%{width}', width.toString())\n .replace('%{height}', height.toString());\n }\n /**\n * Whether the video is public or not.\n */\n get isPublic() {\n return this[rawDataSymbol].viewable === 'public';\n }\n /**\n * The number of views of the video.\n */\n get views() {\n return this[rawDataSymbol].view_count;\n }\n /**\n * The language of the video.\n */\n get language() {\n return this[rawDataSymbol].language;\n }\n /**\n * The type of the video.\n */\n get type() {\n return this[rawDataSymbol].type;\n }\n /**\n * The duration of the video, as formatted by Twitch.\n */\n get duration() {\n return this[rawDataSymbol].duration;\n }\n /**\n * The duration of the video, in seconds.\n */\n get durationInSeconds() {\n const parts = this[rawDataSymbol].duration.match(/\\d+[hms]/g);\n if (!parts) {\n throw new HellFreezesOverError(`Could not parse duration string: ${this[rawDataSymbol].duration}`);\n }\n return parts\n .map(part => {\n const partialMatch = /(\\d+)([hms])/.exec(part);\n if (!partialMatch) {\n throw new HellFreezesOverError(`Could not parse partial duration string: ${part}`);\n }\n const [, num, unit] = partialMatch;\n return parseInt(num, 10) * { h: 3600, m: 60, s: 1 }[unit];\n })\n .reduce((a, b) => a + b);\n }\n /**\n * The ID of the stream this video belongs to.\n *\n * Returns null if the video is not an archived stream.\n */\n get streamId() {\n return this[rawDataSymbol].stream_id;\n }\n /**\n * The raw data of muted segments of the video.\n */\n get mutedSegmentData() {\n return this[rawDataSymbol].muted_segments?.slice() ?? [];\n }\n /**\n * Checks whether the video is muted at a given offset or range.\n *\n * @param offset The start of your range, in seconds from the start of the video,\n * or if no duration is given, the exact offset that is checked.\n * @param duration The duration of your range, in seconds.\n * @param partial Whether the range check is only partial.\n *\n * By default, this function returns true only if the passed range is entirely contained in a muted segment.\n */\n isMutedAt(offset, duration, partial = false) {\n if (this[rawDataSymbol].muted_segments === null) {\n return false;\n }\n if (duration == null) {\n return this[rawDataSymbol].muted_segments.some(seg => seg.offset <= offset && offset <= seg.offset + seg.duration);\n }\n const end = offset + duration;\n if (partial) {\n return this[rawDataSymbol].muted_segments.some(seg => {\n const segEnd = seg.offset + seg.duration;\n return offset < segEnd && seg.offset < end;\n });\n }\n return this[rawDataSymbol].muted_segments.some(seg => {\n const segEnd = seg.offset + seg.duration;\n return seg.offset <= offset && end <= segEnd;\n });\n }\n};\n__decorate([\n Enumerable(false)\n], HelixVideo.prototype, \"_client\", void 0);\n__decorate([\n CachedGetter()\n], HelixVideo.prototype, \"durationInSeconds\", null);\nHelixVideo = __decorate([\n Cacheable,\n rtfm('api', 'HelixVideo', 'id')\n], HelixVideo);\nexport { HelixVideo };\n", "var HelixVideoApi_1;\nimport { __decorate } from \"tslib\";\nimport { Enumerable } from '@d-fischer/shared-utils';\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { HelixRequestBatcher } from '../../utils/HelixRequestBatcher.js';\nimport { HelixPaginatedRequest } from '../../utils/pagination/HelixPaginatedRequest.js';\nimport { createPaginatedResult } from '../../utils/pagination/HelixPaginatedResult.js';\nimport { createPaginationQuery } from '../../utils/pagination/HelixPagination.js';\nimport { BaseApi } from '../BaseApi.js';\nimport { HelixVideo } from './HelixVideo.js';\n/**\n * The Helix API methods that deal with videos.\n *\n * Can be accessed using `client.videos` on an {@link ApiClient} instance.\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * const { data: videos } = await api.videos.getVideosByUser('125328655');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Videos\n */\nlet HelixVideoApi = HelixVideoApi_1 = class HelixVideoApi extends BaseApi {\n /** @internal */\n _getVideoByIdBatcher = new HelixRequestBatcher({\n url: 'videos',\n }, 'id', 'id', this._client, (data) => new HelixVideo(data, this._client));\n /**\n * Gets the video data for the given list of video IDs.\n *\n * @param ids The video IDs you want to look up.\n */\n async getVideosByIds(ids) {\n const result = await this._getVideos('id', ids);\n return result.data;\n }\n /**\n * Gets the video data for the given video ID.\n *\n * @param id The video ID you want to look up.\n */\n async getVideoById(id) {\n const videos = await this.getVideosByIds([id]);\n return videos.length ? videos[0] : null;\n }\n /**\n * Gets the video data for the given video ID, batching multiple calls into fewer requests as the API allows.\n *\n * @param id The video ID you want to look up.\n */\n async getVideoByIdBatched(id) {\n return await this._getVideoByIdBatcher.request(id);\n }\n /**\n * Gets the videos of the given user.\n *\n * @param user The user you want to get videos from.\n * @param filter\n *\n * @expandParams\n */\n async getVideosByUser(user, filter = {}) {\n const userId = extractUserId(user);\n return await this._getVideos('user_id', [userId], filter);\n }\n /**\n * Creates a paginator for videos of the given user.\n *\n * @param user The user you want to get videos from.\n * @param filter\n *\n * @expandParams\n */\n getVideosByUserPaginated(user, filter = {}) {\n const userId = extractUserId(user);\n return this._getVideosPaginated('user_id', [userId], filter);\n }\n /**\n * Gets the videos of the given game.\n *\n * @param gameId The game you want to get videos from.\n * @param filter\n *\n * @expandParams\n */\n async getVideosByGame(gameId, filter = {}) {\n return await this._getVideos('game_id', [gameId], filter);\n }\n /**\n * Creates a paginator for videos of the given game.\n *\n * @param gameId The game you want to get videos from.\n * @param filter\n *\n * @expandParams\n */\n getVideosByGamePaginated(gameId, filter = {}) {\n return this._getVideosPaginated('game_id', [gameId], filter);\n }\n /**\n * Deletes videos by its IDs.\n *\n * @param broadcaster The broadcaster to delete the videos for.\n * @param ids The IDs of the videos to delete.\n */\n async deleteVideosByIds(broadcaster, ids) {\n await this._client.callApi({\n type: 'helix',\n url: 'videos',\n method: 'DELETE',\n scopes: ['channel:manage:videos'],\n userId: extractUserId(broadcaster),\n query: {\n id: ids,\n },\n });\n }\n /** @internal */\n async _getVideos(filterType, filterValues, filter = {}) {\n if (!filterValues.length) {\n return { data: [] };\n }\n const result = await this._client.callApi({\n type: 'helix',\n url: 'videos',\n userId: filterType === 'user_id' ? filterValues[0] : undefined,\n query: {\n ...HelixVideoApi_1._makeVideosQuery(filterType, filterValues, filter),\n ...createPaginationQuery(filter),\n },\n });\n return createPaginatedResult(result, HelixVideo, this._client);\n }\n /** @internal */\n _getVideosPaginated(filterType, filterValues, filter = {}) {\n return new HelixPaginatedRequest({\n url: 'videos',\n userId: filterType === 'user_id' ? filterValues[0] : undefined,\n query: HelixVideoApi_1._makeVideosQuery(filterType, filterValues, filter),\n }, this._client, data => new HelixVideo(data, this._client));\n }\n /** @internal */\n static _makeVideosQuery(filterType, filterValues, filter = {}) {\n const { language, period, orderBy, type } = filter;\n return {\n [filterType]: filterValues,\n language,\n period,\n sort: orderBy,\n type,\n };\n }\n};\n__decorate([\n Enumerable(false)\n], HelixVideoApi.prototype, \"_getVideoByIdBatcher\", void 0);\nHelixVideoApi = HelixVideoApi_1 = __decorate([\n rtfm('api', 'HelixVideoApi')\n], HelixVideoApi);\nexport { HelixVideoApi };\n", "import { extractUserId } from '@twurple/common';\n/** @internal */\nexport function createWhisperQuery(from, to) {\n return {\n from_user_id: extractUserId(from),\n to_user_id: extractUserId(to),\n };\n}\n", "import { __decorate } from \"tslib\";\nimport { extractUserId, rtfm } from '@twurple/common';\nimport { createWhisperQuery } from '../../interfaces/endpoints/whisper.external.js';\nimport { BaseApi } from '../BaseApi.js';\n/**\n * The API methods that deal with whispers.\n *\n * Can be accessed using 'client.whispers' on an {@link ApiClient} instance\n *\n * ## Example\n * ```ts\n * const api = new ApiClient({ authProvider });\n * await api.whispers.sendWhisper('61369223', '86753099', 'Howdy, partner!');\n * ```\n *\n * @meta category helix\n * @meta categorizedTitle Whispers\n */\nlet HelixWhisperApi = class HelixWhisperApi extends BaseApi {\n /**\n * Sends a whisper message to the specified user.\n *\n * NOTE: The API may silently drop whispers that it suspects of violating Twitch policies. (The API does not indicate that it dropped the whisper; it returns a 204 status code as if it succeeded).\n *\n * @param from The user sending the whisper. This user must have a verified phone number and must match the user in the access token.\n * @param to The user to receive the whisper.\n * @param message The whisper message to send. The message must not be empty.\n *\n * The maximum message lengths are:\n *\n * 500 characters if the user you're sending the message to hasn't whispered you before.\n * 10,000 characters if the user you're sending the message to has whispered you before.\n *\n * Messages that exceed the maximum length are truncated.\n */\n async sendWhisper(from, to, message) {\n await this._client.callApi({\n type: 'helix',\n url: 'whispers',\n method: 'POST',\n userId: extractUserId(from),\n scopes: ['user:manage:whispers'],\n query: createWhisperQuery(from, to),\n jsonBody: {\n message,\n },\n });\n }\n};\nHelixWhisperApi = __decorate([\n rtfm('api', 'HelixWhisperApi')\n], HelixWhisperApi);\nexport { HelixWhisperApi };\n", "/**\n * Reporting details for an API request.\n */\nexport class ApiReportedRequest {\n _options;\n _httpStatus;\n _resolvedUserId;\n /** @internal */\n constructor(_options, _httpStatus, _resolvedUserId) {\n this._options = _options;\n this._httpStatus = _httpStatus;\n this._resolvedUserId = _resolvedUserId;\n }\n /**\n * The options used to call the API.\n */\n get options() {\n return this._options;\n }\n /**\n * The HTTP status code returned by Twitch for the request.\n */\n get httpStatus() {\n return this._httpStatus;\n }\n /**\n * The ID of the user that was used for authentication, or `null` if an app access token was used.\n */\n get resolvedUserId() {\n return this._resolvedUserId;\n }\n}\n", "import { __decorate } from \"tslib\";\nimport { rtfm } from '@twurple/common';\nimport { BaseApiClient } from './BaseApiClient.js';\n/** @private */\nlet NoContextApiClient = class NoContextApiClient extends BaseApiClient {\n /** @internal */\n _getUserIdFromRequestContext() {\n return null;\n }\n};\nNoContextApiClient = __decorate([\n rtfm('api', 'ApiClient')\n], NoContextApiClient);\nexport { NoContextApiClient };\n", "import { __decorate } from \"tslib\";\nimport { rtfm } from '@twurple/common';\nimport { BaseApiClient } from './BaseApiClient.js';\n/** @private */\nlet UserContextApiClient = class UserContextApiClient extends BaseApiClient {\n _userId;\n /** @internal */\n constructor(config, logger, rateLimiter, _userId) {\n super(config, logger, rateLimiter);\n this._userId = _userId;\n }\n /** @internal */\n _getUserIdFromRequestContext() {\n return this._userId;\n }\n};\nUserContextApiClient = __decorate([\n rtfm('api', 'ApiClient')\n], UserContextApiClient);\nexport { UserContextApiClient };\n", "import BTTVEmote from './BTTVEmote.js'\nimport Channel from './Channel.js'\nimport Collection from '../util/Collection.js'\nimport Constants from '../util/Constants.js'\nimport FFZEmote from './FFZEmote.js'\nimport SevenTVEmote from './SevenTVEmote.js'\nimport TwitchEmote from './TwitchEmote.js'\n\nimport { ApiClient } from '@twurple/api'\nimport { AppTokenAuthProvider } from '@twurple/auth'\n\nclass EmoteFetcher {\n /**\n * Fetches and caches emotes.\n * @param {object} [options={}] Fetcher's options.\n * @param {string} [options.twitchAppID] Your app ID for the Twitch API.\n * @param {string} [options.twitchAppSecret] Your app secret for the Twitch API.\n * @param {ApiClient} [options.apiClient] - Bring your own Twurple ApiClient.\n * @param {boolean} [options.forceStatic=false] - Force emotes to be static (non-animated).\n * @param {'dark' | 'light'} [options.twitchThemeMode='dark'] - Theme mode (background color) preference for Twitch emotes.\n */\n constructor (options = {}) {\n if (options.apiClient) {\n /**\n * Provided Twitch ApiClient.\n * @type {ApiClient}\n */\n this.apiClient = options.apiClient\n } else if (options.twitchAppID && options.twitchAppSecret) {\n const authProvider = new AppTokenAuthProvider(options.twitchAppID, options.twitchAppSecret)\n /**\n * Twitch API client.\n * @type {ApiClient}\n */\n this.apiClient = new ApiClient({ authProvider })\n }\n\n /**\n * Force emotes to be static (non-animated).\n * @type {boolean}\n */\n this.forceStatic = options.forceStatic || false\n\n /**\n * Theme mode (background color) preference for Twitch emotes.\n * @type {'dark' | 'light'}\n */\n this.twitchThemeMode = options.twitchThemeMode || 'dark'\n\n /**\n * Cached emotes.\n * Collectionped by emote code to Emote instance.\n * @type {Collection<string, Emote>}\n */\n this.emotes = new Collection()\n\n /**\n * Cached channels.\n * Collectionped by name to Channel instance.\n * @type {Collection<string, Channel>}\n */\n this.channels = new Collection()\n\n /**\n * Save if we fetched FFZ's modifier emotes once.\n * @type {boolean}\n */\n this.ffzModifiersFetched = false\n }\n\n /**\n * The global channel for Twitch, BTTV and 7TV.\n * @readonly\n * @type {?Channel}\n */\n get globalChannel () {\n return this.channels.get(null)\n }\n\n /**\n * Sets up a channel\n * @private\n * @param {number} channelId - ID of the channel.\n * @param {string} [format] - The type file format to use (webp/avif).\n * @throws {Error} When Twitch Client ID or Client Secret were not provided.\n * @returns {Channel} - A Channel instance.\n */\n _setupChannel (channelId, format) {\n let channel = this.channels.get(channelId)\n if (!channel) {\n channel = new Channel(this, channelId)\n this.channels.set(channelId, channel)\n }\n if (format) channel.format = format.toLowerCase()\n return channel\n }\n\n /**\n * Gets the raw Twitch emotes data for a channel.\n * @private\n * @param {number} id - ID of the channel.\n * @returns {Promise<object[]>} - A promise that resolves to an array of raw Twitch emote data.\n */\n _getRawTwitchEmotes (id) {\n if (!this.apiClient) {\n throw new Error('Client id or client secret not provided.')\n }\n\n if (id) {\n return this.apiClient.chat.getChannelEmotes(id)\n } else {\n return this.apiClient.chat.getGlobalEmotes()\n }\n }\n\n /**\n * Converts and caches a raw twitch emote.\n * @private\n * @param {number} channelId - ID of the channel.\n * @param {object} data - Raw data.\n * @param {TwitchEmote} [existingEmote] - Existing emote to cache.\n * @returns {TwitchEmote} - A TwitchEmote instance.\n */\n _cacheTwitchEmote (channelId, data, existingEmote) {\n const channel = this._setupChannel(channelId)\n const emote = existingEmote || new TwitchEmote(channel, data.id, data)\n this.emotes.set(emote.code, emote)\n channel.emotes.set(emote.code, emote)\n return emote\n }\n\n /**\n * Gets the raw BTTV emotes data for a channel.\n * Use `null` for the global emotes channel.\n * @private\n * @param {number} [id] - ID of the channel.\n * @returns {Promise<object[]>} - A promise that resolves to an array of raw BTTV emote data.\n */\n _getRawBTTVEmotes (id) {\n const endpoint = id\n ? Constants.BTTV.Channel(id)\n : Constants.BTTV.Global\n\n return fetch(endpoint)\n .then((response) => response.json())\n .then((data) => {\n // Global emotes\n if (Array.isArray(data)) return data\n // Channel emotes\n if (data?.channelEmotes && data?.sharedEmotes) {\n return [\n ...data.channelEmotes,\n ...data.sharedEmotes,\n ]\n }\n // Fallback - in case the response format is unexpected\n return data || []\n })\n }\n\n /**\n * Converts and caches a raw BTTV emote.\n * @private\n * @param {number} channelId - ID of the channel.\n * @param {object} data - Raw data.\n * @param {BTTVEmote} [existingEmote] - Existing emote to cache.\n * @returns {BTTVEmote} - A BTTVEmote instance.\n */\n _cacheBTTVEmote (channelId, data, existingEmote) {\n const channel = this._setupChannel(channelId)\n const emote = existingEmote || new BTTVEmote(channel, data.id, data)\n this.emotes.set(emote.code, emote)\n channel.emotes.set(emote.code, emote)\n return emote\n }\n\n /**\n * Gets the raw FFZ emote data from a set.\n * @private\n * @param {number} id - ID of the set.\n * @returns {Promise<object[]>} - A promise that resolves to an array of raw FFZ emote data.\n */\n _getRawFFZEmoteSet (id) {\n const endpoint = Constants.FFZ.Set(id)\n\n return fetch(endpoint)\n .then((response) => response.json())\n .then((data) => {\n return data.set.emoticons\n })\n }\n\n /**\n * Gets the raw FFZ emotes data for a channel.\n * @private\n * @param {number} id - ID of the channel.\n * @returns {Promise<object[]>} - A promise that resolves to an array of raw FFZ emote data.\n */\n _getRawFFZEmotes (id) {\n const endpoint = Constants.FFZ.Channel(id)\n\n return fetch(endpoint)\n .then((response) => response.json())\n .then((data) => {\n const emotes = []\n for (const key of Object.keys(data.sets)) {\n const set = data.sets[key]\n emotes.push(...set.emoticons)\n }\n\n return emotes\n })\n }\n\n /**\n * Converts and caches a raw FFZ emote.\n * @private\n * @param {number} channelId - ID of the channel.\n * @param {object} data - Raw data.\n * @param {FFZEmote} [existingEmote] - Existing emote to cache.\n * @returns {FFZEmote} - A FFZEmote instance.\n */\n _cacheFFZEmote (channelId, data, existingEmote) {\n const channel = this._setupChannel(channelId)\n const emote = existingEmote || new FFZEmote(channel, data.id, data)\n this.emotes.set(emote.code, emote)\n channel.emotes.set(emote.code, emote)\n return emote\n }\n\n /**\n * Gets the raw 7TV emotes data for a channel.\n * @private\n * @param {number} [id] - ID of the channel.\n * @returns {Promise<object[]>} - A promise that resolves to an array of raw 7TV emote data.\n */\n _getRawSevenTVEmotes (id) {\n const endpoint = id\n ? Constants.SevenTV.Channel(id)\n : Constants.SevenTV.Global\n\n return fetch(endpoint).then((response) => response.json())\n }\n\n /**\n * Converts and caches a raw 7TV emote.\n * @private\n * @param {number} channelId - ID of the channel.\n * @param {object} data - Raw data.\n * @param {string} format - The type file format to use (webp/avif).\n * @param {SevenTVEmote} [existingEmote] - Existing emote to cache.\n * @returns {SevenTVEmote} - A SevenTVEmote instance.\n */\n _cacheSevenTVEmote (channelId, data, format, existingEmote) {\n const channel = this._setupChannel(channelId, format)\n const emote = existingEmote || new SevenTVEmote(channel, data.id, data)\n this.emotes.set(emote.code, emote)\n channel.emotes.set(emote.code, emote)\n return emote\n }\n\n /**\n * Fetches the Twitch emotes for a channel.\n * Use `null` for the global emotes channel.\n * @param {number} [channel] - ID of the channel.\n * @returns {Promise<Collection<string, TwitchEmote>>} - A promise that resolves to a collection of TwitchEmotes.\n */\n fetchTwitchEmotes (channel) {\n return this._getRawTwitchEmotes(channel).then((rawEmotes) => {\n for (const emote of rawEmotes) {\n this._cacheTwitchEmote(channel, {\n code: emote.name, id: emote.id, formats: emote.formats,\n })\n }\n\n return this.channels.get(channel).emotes.filter((e) => e.type === 'twitch')\n })\n }\n\n /**\n * Fetches the BTTV emotes for a channel.\n * Use `null` for the global emotes channel.\n * @param {number} [channel] - ID of the channel.\n * @returns {Promise<Collection<string, BTTVEmote>>} - A promise that resolves to a collection of BTTVEmotes.\n */\n fetchBTTVEmotes (channel) {\n return this._getRawBTTVEmotes(channel).then((rawEmotes) => {\n for (const data of rawEmotes) {\n this._cacheBTTVEmote(channel, data)\n }\n\n return this.channels.get(channel).emotes.filter((e) => e.type === 'bttv')\n })\n }\n\n /**\n * Fetches the FFZ emotes for a channel.\n * @param {number} [channel] - ID of the channel.\n * @returns {Promise<Collection<string, FFZEmote>>} - A promise that resolves to a collection of FFZEmotes.\n */\n async fetchFFZEmotes (channel) {\n // Fetch modifier emotes at least once\n if (!this.ffzModifiersFetched) {\n this.ffzModifiersFetched = true\n\n await this._getRawFFZEmoteSet(Constants.FFZ.sets.Modifiers).then((rawEmotes) => {\n for (const data of rawEmotes) {\n this._cacheFFZEmote(null, data)\n }\n })\n }\n\n // If no channel specified, fetch the Global set\n if (!channel) {\n return this._getRawFFZEmoteSet(Constants.FFZ.sets.Global).then((rawEmotes) => {\n for (const data of rawEmotes) {\n this._cacheFFZEmote(channel, data)\n }\n\n return this.channels.get(channel).emotes.filter((e) => e.type === 'ffz')\n })\n }\n\n return this._getRawFFZEmotes(channel).then((rawEmotes) => {\n for (const data of rawEmotes) {\n this._cacheFFZEmote(channel, data)\n }\n\n return this.channels.get(channel).emotes.filter((e) => e.type === 'ffz')\n })\n }\n\n /**\n * Fetches the 7TV emotes for a channel.\n * @param {number} [channel] - ID of the channel.\n * @param {object} [options] - Options for fetching.\n * @param {('webp'|'avif')} [options.format] - The type file format to use (webp/avif).\n * @returns {Promise<Collection<string, SevenTVEmote>>} - A promise that resolves to a collection of SevenTVEmotes.\n */\n fetchSevenTVEmotes (channel, options) {\n const {\n format = 'webp',\n } = options || {}\n\n return this._getRawSevenTVEmotes(channel).then((rawEmotes) => {\n if (Object.hasOwn(rawEmotes, 'emotes')) {\n // From an emote set (like \"global\")\n for (const data of rawEmotes.emotes) {\n this._cacheSevenTVEmote(channel, data, format)\n }\n } else {\n // From users\n for (const data of rawEmotes.emote_set.emotes) {\n this._cacheSevenTVEmote(channel, data, format)\n }\n }\n\n return this.channels.get(channel).emotes.filter((e) => e.type === '7tv')\n })\n }\n\n /**\n * Converts emote Objects to emotes\n * @param {object} [emotesArray] - An array of emote objects\n * @throws {TypeError} When an emote has an unknown type.\n * @returns {Emote[]} - An array of Emote instances.\n */\n fromObject (emotesArray) {\n const emotes = []\n const classMap = {\n 'bttv': { class: BTTVEmote, cache: (emoteObject, channelId, existingEmote) => this._cacheBTTVEmote(channelId, null, existingEmote) },\n 'ffz': { class: FFZEmote, cache: (emoteObject, channelId, existingEmote) => this._cacheFFZEmote(channelId, null, existingEmote) },\n '7tv': { class: SevenTVEmote, cache: (emoteObject, channelId, existingEmote) => this._cacheSevenTVEmote(channelId, null, emoteObject.imageType, existingEmote) },\n 'twitch': { class: TwitchEmote, cache: (emoteObject, channelId, existingEmote) => this._cacheTwitchEmote(channelId, null, existingEmote) },\n }\n\n for (const emoteObject of emotesArray) {\n const { type } = emoteObject\n if (!Object.keys(classMap).includes(type)) {\n throw new TypeError(`Unknown type: ${type}`)\n }\n\n const emoteClass = classMap[type].class\n this._setupChannel(emoteObject.channel_id, type === '7tv' ? emoteObject.imageType : null)\n const emote = emoteClass.fromObject(emoteObject, this.channels.get(emoteObject.channel_id))\n classMap[type].cache(emoteObject, emoteObject.channel_id, emote)\n emotes.push(emote)\n }\n return emotes\n }\n}\n\nexport default EmoteFetcher\n", "import Constants from '../util/Constants.js'\n\nclass EmoteParser {\n /**\n * A parser to replace text with emotes.\n * @param {EmoteFetcher} fetcher - The fetcher to use the cache of.\n * @param {object} [options={}] - Options for the parser.\n * @param {string} [options.template=''] - The template to be used.\n * The strings that can be interpolated are:\n * - `{link}` The link of the emote.\n * - `{name}` The name of the emote.\n * - `{size}` The size index of the image.\n * - `{creator}` The channel/owner name of the emote.\n * @param {'html' | 'markdown' | 'bbcode' | 'plain'} [options.type='html'] - The type of the parser.\n * Can be one of `html`, `markdown`, `bbcode`, or `plain`.\n * If the `template` option is provided, this is ignored.\n * @param {RegExp} [options.match=/(\\w+)/g] - The regular expression that matches an emote.\n * Must be a global regex, with one capture group for the emote code.\n */\n constructor (fetcher, options = {}) {\n /**\n * The emote fetcher being used.\n * @type {EmoteFetcher}\n */\n this.fetcher = fetcher\n\n /**\n * The parser options.\n * @type {object}\n */\n this.options = {\n template: '',\n type: 'html',\n match: /(\\w+)/g,\n ...options,\n }\n\n this._validateOptions(this.options)\n }\n\n /**\n * Validates the parser options.\n * @private\n * @param {object} [options] - Options for the parser.\n * @param {string} [options.template] - The template to be used.\n * The strings that can be interpolated are:\n * - `{link}` The link of the emote.\n * - `{name}` The name of the emote.\n * - `{size}` The size of the image.\n * - `{creator}` The channel/owner name of the emote.\n * @param {'html' | 'markdown' | 'bbcode' | 'plain'} [options.type] - The type of the parser.\n * Can be one of `html`, `markdown`, `bbcode`, or `plain`.\n * If the `template` option is provided, this is ignored.\n * @param {RegExp} [options.match] - The regular expression that matches an emote.\n * Must be a global regex, with one capture group for the emote code.\n * @throws {TypeError} When template is not a string.\n * @throws {TypeError} When type is not one of the supported types.\n * @throws {TypeError} When match is not a global RegExp.\n */\n _validateOptions (options) {\n if (options.template && typeof options.template !== 'string') {\n throw new TypeError('Template must be a string')\n }\n\n if (!['html', 'markdown', 'bbcode', 'plain'].includes(options.type)) {\n throw new TypeError('Parse type must be one of `html`, `markdown`, `bbcode`, or `plain`')\n }\n\n if (!(options.match instanceof RegExp) || !options.match.global) {\n throw new TypeError('Match must be a global RegExp.')\n }\n }\n\n /**\n * Parses text.\n * @param {string} text - Text to parse.\n * @param {object} [options] - Parameters for parsing.\n * @param {number} [options.size] - Size (scale) for emotes.\n * @param {boolean} [options.forceStatic] - Whether to force the emote to be static (non-animated). Defaults to the fetcher's forceStatic or `false`.\n * @param {'dark' | 'light'} [options.themeMode] - Only for Twitch: the preferred theme mode. Defaults to the fetcher's twitchThemeMode or `dark`.\n * @returns {string} - The parsed text.\n */\n parse (text, options) {\n // @NOTE(kody): Not setting defaults here, they'll be handled by each emote's toLink method.\n const {\n size,\n forceStatic,\n themeMode,\n } = options || {}\n\n const parsed = text.replace(this.options.match, (matched, id) => {\n const emote = this.fetcher.emotes.get(id)\n if (!emote) return matched\n if (emote.modifier) return ''\n\n const template = this.options.template || Constants.Templates[this.options.type]\n const link = emote.toLink({ size, forceStatic, themeMode })\n const res = template\n .replaceAll('{link}', link)\n .replaceAll('{name}', emote.code)\n .replaceAll('{size}', size)\n .replaceAll('{creator}', emote.ownerName || 'global')\n\n return res\n })\n\n return parsed\n }\n}\n\nexport default EmoteParser\n", "/// <reference types=\"../typings/index.d.ts\" />\nimport BTTVEmote from './struct/BTTVEmote.js'\nimport Channel from './struct/Channel.js'\nimport Collection from './util/Collection.js'\nimport Constants from './util/Constants.js'\nimport Emote from './struct/Emote.js'\nimport EmoteFetcher from './struct/EmoteFetcher.js'\nimport EmoteParser from './struct/EmoteParser.js'\nimport FFZEmote from './struct/FFZEmote.js'\nimport SevenTVEmote from './struct/SevenTVEmote.js'\nimport TwitchEmote from './struct/TwitchEmote.js'\n\nexport {\n BTTVEmote,\n Channel,\n Collection,\n Constants,\n Emote,\n EmoteFetcher,\n EmoteParser,\n FFZEmote,\n SevenTVEmote,\n TwitchEmote,\n}\n\n// Default export for compatibility\nexport default {\n BTTVEmote,\n Channel,\n Collection,\n Constants,\n Emote,\n EmoteFetcher,\n EmoteParser,\n FFZEmote,\n SevenTVEmote,\n TwitchEmote,\n}\n"],
|
|
5
|
+
"mappings": "8kBAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAA,GAAO,QAAQ,OAAS,KCAxB,IAAAC,GAAAC,GAAA,CAAAC,GAAAC,KAAA,UAASC,EAAeC,EAAUC,EAAS,CAErC,OAAOA,GAAY,YACrBA,EAAU,CAAE,QAASA,CAAQ,GAG/B,KAAK,kBAAoB,KAAK,MAAM,KAAK,UAAUD,CAAQ,CAAC,EAC5D,KAAK,UAAYA,EACjB,KAAK,SAAWC,GAAW,CAAC,EAC5B,KAAK,cAAgBA,GAAWA,EAAQ,cAAgB,IACxD,KAAK,IAAM,KACX,KAAK,QAAU,CAAC,EAChB,KAAK,UAAY,EACjB,KAAK,kBAAoB,KACzB,KAAK,oBAAsB,KAC3B,KAAK,SAAW,KAChB,KAAK,gBAAkB,KACvB,KAAK,OAAS,KAEV,KAAK,SAAS,UAChB,KAAK,gBAAkB,KAAK,UAAU,MAAM,CAAC,EAEjD,CAtBSC,EAAAH,EAAA,kBAuBTD,GAAO,QAAUC,EAEjBA,EAAe,UAAU,MAAQ,UAAW,CAC1C,KAAK,UAAY,EACjB,KAAK,UAAY,KAAK,kBAAkB,MAAM,CAAC,CACjD,EAEAA,EAAe,UAAU,KAAO,UAAW,CACrC,KAAK,UACP,aAAa,KAAK,QAAQ,EAExB,KAAK,QACP,aAAa,KAAK,MAAM,EAG1B,KAAK,UAAkB,CAAC,EACxB,KAAK,gBAAkB,IACzB,EAEAA,EAAe,UAAU,MAAQ,SAASI,EAAK,CAK7C,GAJI,KAAK,UACP,aAAa,KAAK,QAAQ,EAGxB,CAACA,EACH,MAAO,GAET,IAAIC,EAAc,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UAAAC,EACA,MAAAC,EACA,aAAAC,GACA,YAAAC,GACA,SAAAC,GACA,aAAAC,GACA,YAAAC,EACF",
|
|
6
|
+
"names": ["require_browser", "__commonJSMin", "exports", "module", "require_retry_operation", "__commonJSMin", "exports", "module", "RetryOperation", "timeouts", "options", "__name", "err", "currentTime", "timeout", "self", "fn", "timeoutOps", "counts", "mainError", "mainErrorCount", "i", "error", "message", "count", "require_retry", "__commonJSMin", "exports", "RetryOperation", "options", "timeouts", "opts", "key", "i", "a", "b", "attempt", "random", "timeout", "obj", "methods", "method", "original", "__name", "op", "args", "callback", "err", "require_retry", "__commonJSMin", "exports", "module", "Emote", "_Emote", "__name", "channel", "id", "data", "Emote_default", "Constants_default", "__name", "id", "size", "forceStatic", "theme", "format", "BTTVEmote", "_BTTVEmote", "Emote_default", "__name", "channel", "id", "data", "options", "size", "forceStatic", "Constants_default", "emoteObject", "BTTVEmote_default", "Collection", "__name", "propOrFunc", "value", "item", "i", "func", "thisArg", "results", "key", "array", "Collection_default", "Channel", "__name", "fetcher", "id", "Collection_default", "Channel_default", "FFZEmote", "_FFZEmote", "Emote_default", "__name", "channel", "id", "data", "options", "size", "forceStatic", "sizeKey", "Constants_default", "emoteObject", "sizesObj", "acc", "curr", "FFZEmote_default", "SevenTVEmote", "_SevenTVEmote", "Emote_default", "__name", "channel", "id", "data", "el", "options", "size", "forceStatic", "sizeKey", "Constants_default", "emoteObject", "sizes", "SevenTVEmote_default", "TwitchEmote", "_TwitchEmote", "Emote_default", "__name", "channel", "id", "data", "options", "size", "forceStatic", "themeMode", "Constants_default", "emoteObject", "TwitchEmote_default", "extendStatics", "__name", "d", "b", "p", "__extends", "__", "__decorate", "decorators", "target", "key", "desc", "c", "r", "d", "i", "__name", "__read", "o", "n", "m", "i", "r", "ar", "e", "error", "__name", "__spreadArray", "to", "from", "pack", "i", "l", "ar", "__name", "import_detect_node", "import_detect_node", "import_detect_node", "_a", "LogLevel", "resolveLogLevel", "level", "eligibleLevels", "k", "strLevel", "__name", "debugFunction", "LogLevelToConsoleFunction", "Enumerable", "enumerable", "target", "key", "__name", "val", "flatten", "arr", "_a", "__spreadArray", "__read", "__name", "arrayToObject", "arr", "fn", "__spreadArray", "__read", "__name", "indexBy", "arr", "keyFn", "key_1", "__name", "value", "arrayToObject", "val", "_a", "isNullish", "value", "__name", "mapNullable", "cb", "mapOptional", "promiseWithResolvers", "resolve", "reject", "promise", "_resolve", "_reject", "__name", "import_detect_node", "_a", "_b", "data", "part", "namespace", "strLevel", "resolveLogLevel", "v", "_c", "_d", "b", "defaultIndex", "nsParts", "defaultLevel", "isPrefix", "value", "prefix", "item", "i", "__name", "getMinLogLevelFromEnv", "name", "nameSplit", "_i", "data_1", "level", "BaseLogger", "_a", "name", "minLevel", "_b", "emoji", "colors", "_c", "timestamps", "_d", "_e", "mapOptional", "lv", "resolveLogLevel", "getMinLogLevelFromEnv", "LogLevel", "__name", "message", "BrowserLogger", "_super", "__extends", "__name", "level", "message", "logFn", "LogLevelToConsoleFunction", "formattedMessage", "BaseLogger", "CustomLoggerWrapper", "_a", "name", "minLevel", "custom", "_b", "mapOptional", "lv", "resolveLogLevel", "getMinLogLevelFromEnv", "__name", "level", "message", "LogLevel", "_a", "_b", "_c", "LogLevelToEmoji", "LogLevel", "colors", "bgColors", "createGenericWrapper", "color", "ending", "inner", "str", "__name", "createColorWrapper", "createBgWrapper", "fgWrapper", "LogLevelToColor", "LogLevelToBackgroundColor", "NodeLogger", "_super", "__extends", "level", "message", "logFn", "LogLevelToConsoleFunction", "builtMessage", "emoji", "useColors", "BaseLogger", "createLogger", "options", "CustomLoggerWrapper", "NodeLogger", "BrowserLogger", "__name", "CustomError", "__name", "params", "_a", "RateLimiterDestroyedError", "CustomError", "__name", "RateLimitReachedError", "CustomError", "__name", "RetryAfterError", "CustomError", "__name", "after", "ResponseBasedRateLimiter", "__name", "logger", "createLogger", "req", "options", "resolve", "reject", "_a", "reqSpec", "_b", "_c", "_d", "_e", "mapNullable", "v", "reqSpecs", "promises", "result", "retry", "RetryAfterError", "params", "e", "settledPromises", "rejectedPromises", "p", "now", "retryAfter", "carry", "delay", "entry", "RateLimitReachedError", "amount", "PartitionedRateLimiter", "__name", "options", "req", "partitionKey", "child", "ResponseBasedRateLimiter", "result", "PartitionedTimeBasedRateLimiter", "__name", "logger", "bucketSize", "timeFrame", "doRequest", "getPartitionKey", "createLogger", "req", "options", "resolve", "reject", "_a", "_b", "RateLimiterDestroyedError", "reqSpec", "partitionKey", "usedFromBucket", "queue", "RateLimitReachedError", "timer", "newQueue", "e", "counterTimer", "newUsed", "rawDataSymbol", "DataObject", "__name", "rawDataSymbol", "data", "getMockApiPort", "__name", "qsStringify", "obj", "params", "key", "value", "v", "result", "__name", "CustomError", "__name", "message", "options", "RelationAssertionError", "CustomError", "__name", "checkRelationAssertion", "value", "RelationAssertionError", "__name", "rtfm", "pkg", "name", "idKey", "clazz", "fn", "__name", "HelixExtension", "DataObject", "__name", "rawDataSymbol", "size", "__decorate", "rtfm", "HellFreezesOverError", "CustomError", "__name", "message", "extractUserId", "user", "__name", "extractUserName", "HttpStatusCodeError", "CustomError", "__name", "_statusCode", "statusText", "_url", "_method", "_body", "isJson", "handleTwitchApiResponseError", "response", "options", "isJson", "text", "params", "qsStringify", "fullUrl", "HttpStatusCodeError", "__name", "transformTwitchApiResponse", "getTwitchApiUrl", "url", "type", "mockServerPort", "getMockApiPort", "unprefixedUrl", "__name", "callTwitchApiRaw", "options", "clientId", "accessToken", "authorizationType", "fetchOptions", "type", "url", "getTwitchApiUrl", "params", "qsStringify", "headers", "body", "requestOptions", "__name", "callTwitchApi", "response", "handleTwitchApiResponseError", "transformTwitchApiResponse", "createBroadcasterQuery", "user", "extractUserId", "__name", "ConfigError", "CustomError", "__name", "HelixRateLimiter", "ResponseBasedRateLimiter", "__name", "options", "clientId", "accessToken", "authorizationType", "fetchOptions", "callTwitchApiRaw", "res", "headers", "createSingleCacheKey", "param", "objKey", "__name", "createCacheKey", "propName", "params", "prefix", "cacheSymbol", "Cacheable", "cls", "_a", "_b", "__name", "cacheKey", "entry", "value", "timeInSeconds", "prefix", "internalCacheKey", "val", "key", "now", "propName", "createCacheKey", "CachedGetter", "timeInSeconds", "target", "propName", "descriptor", "origFn", "cacheKey", "createCacheKey", "cachedValue", "result", "__name", "Listener", "__name", "owner", "event", "listener", "_internal", "EventEmitter", "__name", "event", "listener", "idOrEvent", "eventBinder", "handler", "args", "internal", "listenerMap", "Listener", "id", "listeners", "idx", "EXPIRY_GRACE_PERIOD", "getExpiryMillis", "token", "mapNullable", "_", "__name", "accessTokenIsExpired", "token", "mapNullable", "getExpiryMillis", "_", "__name", "InvalidTokenError", "CustomError", "__name", "options", "createGetAppTokenQuery", "clientId", "clientSecret", "__name", "TokenInfo", "DataObject", "__name", "data", "rawDataSymbol", "mapNullable", "v", "__decorate", "rtfm", "createAccessTokenFromData", "data", "__name", "getAppToken", "clientId", "clientSecret", "createAccessTokenFromData", "callTwitchApi", "createGetAppTokenQuery", "__name", "TokenFetcher", "__name", "executor", "scopeSets", "filteredScopeSets", "val", "promise", "resolve", "reject", "promiseWithResolvers", "e", "AppTokenAuthProvider", "__name", "clientId", "clientSecret", "impliedScopes", "TokenFetcher", "scopes", "user", "scopeSets", "scopeSet", "scope", "extractUserId", "forceNew", "accessTokenIsExpired", "getAppToken", "__decorate", "Enumerable", "rtfm", "retry", "createBitsLeaderboardQuery", "params", "count", "period", "startDate", "contextUserId", "__name", "BaseApi", "__name", "client", "userId", "__decorate", "Enumerable", "HelixBitsLeaderboardEntry", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixBitsLeaderboard", "DataObject", "__name", "data", "client", "rawDataSymbol", "entry", "HelixBitsLeaderboardEntry", "__decorate", "Enumerable", "CachedGetter", "Cacheable", "rtfm", "HelixCheermoteList", "DataObject", "__name", "data", "indexBy", "action", "name", "bits", "format", "background", "state", "scale", "tiers", "rawDataSymbol", "correctTier", "a", "b", "tier", "HellFreezesOverError", "__decorate", "rtfm", "HelixBitsApi", "BaseApi", "__name", "broadcaster", "params", "result", "extractUserId", "createBitsLeaderboardQuery", "HelixBitsLeaderboard", "mapOptional", "createBroadcasterQuery", "HelixCheermoteList", "__decorate", "rtfm", "createChannelUpdateBody", "data", "__name", "createChannelCommercialBody", "broadcaster", "length", "extractUserId", "createChannelVipUpdateQuery", "user", "createChannelFollowerQuery", "mapOptional", "createFollowedChannelQuery", "createSingleKeyQuery", "key", "value", "__name", "createUserQuery", "user", "extractUserId", "createModeratorActionQuery", "broadcaster", "moderatorId", "createGetByIdsQuery", "rewardIds", "createChannelUsersCheckQuery", "users", "HelixUserRelation", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixRequestBatcher", "__name", "_callOptions", "_queryParamName", "_matchKey", "client", "_mapper", "_limitPerRequest", "id", "promise", "resolve", "reject", "promiseWithResolvers", "ids", "data", "dataById", "indexBy", "resolver", "result", "e_", "__decorate", "Enumerable", "HelixPaginatedRequest", "__name", "_callOptions", "client", "_mapper", "_limitPerPage", "result", "data", "additionalOptions", "acc", "elem", "mapped", "__decorate", "Enumerable", "rtfm", "HelixPaginatedRequestWithTotal", "HelixPaginatedRequest", "__name", "__decorate", "rtfm", "createPaginatedResult", "response", "type", "client", "dataCache", "data", "__name", "createPaginatedResultWithTotal", "createPaginationQuery", "after", "before", "limit", "__name", "HelixChannel", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixChannelEditor", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixChannelFollower", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixFollowedChannel", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixAdSchedule", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixSnoozeNextAdResult", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixChannelApi", "BaseApi", "__name", "HelixRequestBatcher", "data", "HelixChannel", "user", "userId", "extractUserId", "result", "createBroadcasterQuery", "mapNullable", "users", "userIds", "createSingleKeyQuery", "createChannelUpdateBody", "broadcaster", "length", "createChannelCommercialBody", "HelixChannelEditor", "pagination", "response", "createPaginationQuery", "createPaginatedResult", "HelixUserRelation", "HelixPaginatedRequest", "createChannelUsersCheckQuery", "rel", "createChannelVipUpdateQuery", "createChannelFollowerQuery", "createPaginatedResultWithTotal", "HelixChannelFollower", "HelixPaginatedRequestWithTotal", "createFollowedChannelQuery", "HelixFollowedChannel", "HelixAdSchedule", "HelixSnoozeNextAdResult", "__decorate", "Enumerable", "rtfm", "createCustomRewardsQuery", "broadcaster", "onlyManageable", "extractUserId", "__name", "createCustomRewardChangeQuery", "rewardId", "createCustomRewardBody", "data", "result", "createRewardRedemptionsByIdsQuery", "redemptionIds", "createRedemptionsForBroadcasterQuery", "status", "filter", "HelixCustomReward", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "scale", "urlProp", "__decorate", "Enumerable", "rtfm", "HelixCustomRewardRedemption", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "newStatus", "__decorate", "Enumerable", "rtfm", "HelixChannelPointsApi", "BaseApi", "__name", "broadcaster", "onlyManageable", "extractUserId", "createCustomRewardsQuery", "data", "HelixCustomReward", "rewardIds", "createGetByIdsQuery", "rewardId", "rewards", "result", "createBroadcasterQuery", "createCustomRewardBody", "createCustomRewardChangeQuery", "redemptionIds", "createRewardRedemptionsByIdsQuery", "HelixCustomRewardRedemption", "redemptionId", "redemptions", "status", "filter", "createRedemptionsForBroadcasterQuery", "createPaginationQuery", "createPaginatedResult", "HelixPaginatedRequest", "__decorate", "rtfm", "HelixCharityCampaignAmount", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixCharityCampaign", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "HelixCharityCampaignAmount", "__decorate", "Enumerable", "rtfm", "HelixCharityCampaignDonation", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "HelixCharityCampaignAmount", "__decorate", "Enumerable", "rtfm", "HelixCharityApi", "BaseApi", "__name", "broadcaster", "response", "extractUserId", "createBroadcasterQuery", "HelixCharityCampaign", "pagination", "createPaginationQuery", "createPaginatedResult", "HelixCharityCampaignDonation", "__decorate", "rtfm", "ChatMessageDroppedError", "CustomError", "__name", "broadcasterId", "message", "code", "createChatSettingsUpdateBody", "settings", "__name", "createChatColorUpdateQuery", "user", "color", "extractUserId", "createShoutoutQuery", "from", "to", "moderatorId", "createSendChatMessageQuery", "broadcaster", "sender", "createSendChatMessageBody", "message", "params", "createSendChatMessageAsAppBody", "createSharedChatSessionQuery", "broadcaster", "extractUserId", "__name", "HelixEmoteBase", "DataObject", "__name", "rawDataSymbol", "scale", "themeMode", "format", "HelixEmote", "HelixEmoteBase", "__name", "scale", "rawDataSymbol", "__decorate", "rtfm", "HelixChannelEmote", "HelixEmote", "__name", "data", "client", "rawDataSymbol", "__decorate", "Enumerable", "rtfm", "HelixChatBadgeVersion", "DataObject", "__name", "rawDataSymbol", "scale", "__decorate", "rtfm", "HelixChatBadgeSet", "DataObject", "__name", "rawDataSymbol", "data", "HelixChatBadgeVersion", "versionId", "v", "__decorate", "CachedGetter", "Cacheable", "rtfm", "HelixChatChatter", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixChatSettings", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixEmoteFromSet", "HelixEmote", "__name", "data", "client", "rawDataSymbol", "__decorate", "Enumerable", "rtfm", "HelixPrivilegedChatSettings", "HelixChatSettings", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixSentChatMessage", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixSharedChatSessionParticipant", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixSharedChatSession", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "HelixSharedChatSessionParticipant", "__decorate", "Enumerable", "rtfm", "HelixUserEmote", "HelixEmoteBase", "__name", "data", "client", "rawDataSymbol", "__decorate", "Enumerable", "rtfm", "HelixChatApi", "BaseApi", "__name", "broadcaster", "pagination", "broadcasterId", "extractUserId", "result", "createPaginationQuery", "createPaginatedResultWithTotal", "HelixChatChatter", "HelixPaginatedRequestWithTotal", "data", "HelixChatBadgeSet", "createBroadcasterQuery", "HelixEmote", "HelixChannelEmote", "setIds", "createSingleKeyQuery", "HelixEmoteFromSet", "user", "filter", "userId", "createPaginatedResult", "HelixUserEmote", "HelixPaginatedRequest", "HelixChatSettings", "HelixPrivilegedChatSettings", "settings", "createChatSettingsUpdateBody", "message", "params", "createSendChatMessageQuery", "createSendChatMessageBody", "msg", "HelixSentChatMessage", "createSendChatMessageAsAppBody", "announcement", "users", "response", "color", "createChatColorUpdateQuery", "from", "to", "fromId", "createShoutoutQuery", "createSharedChatSessionQuery", "HelixSharedChatSession", "createModeratorActionQuery", "ChatMessageDroppedError", "__decorate", "rtfm", "createClipCreateQuery", "params", "channel", "createAfterDelay", "title", "duration", "extractUserId", "__name", "createClipCreateFromVodQuery", "editorId", "vodId", "vodOffset", "createClipQuery", "filterType", "ids", "startDate", "endDate", "isFeatured", "HelixClip", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixClipApi", "BaseApi", "__name", "HelixRequestBatcher", "data", "HelixClip", "broadcaster", "filter", "extractUserId", "gameId", "ids", "id", "clips", "params", "createClipCreateQuery", "broadcasterId", "createClipCreateFromVodQuery", "result", "createClipQuery", "createPaginationQuery", "createPaginatedResult", "HelixPaginatedRequest", "__decorate", "Enumerable", "rtfm", "HelixContentClassificationLabel", "DataObject", "__name", "rawDataSymbol", "HelixContentClassificationLabelApi", "BaseApi", "__name", "locale", "data", "HelixContentClassificationLabel", "__decorate", "rtfm", "createDropsEntitlementQuery", "filters", "alwaysApp", "mapOptional", "extractUserId", "__name", "createDropsEntitlementUpdateBody", "ids", "fulfillmentStatus", "HelixDropsEntitlement", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixEntitlementApi", "BaseApi", "__name", "HelixRequestBatcher", "data", "HelixDropsEntitlement", "filter", "alwaysApp", "response", "mapOptional", "extractUserId", "createDropsEntitlementQuery", "createPaginationQuery", "createPaginatedResult", "HelixPaginatedRequest", "ids", "id", "fulfillmentStatus", "createDropsEntitlementUpdateBody", "entry", "__decorate", "Enumerable", "rtfm", "createEventSubBroadcasterCondition", "broadcaster", "extractUserId", "__name", "createEventSubRewardCondition", "rewardId", "createEventSubModeratorCondition", "broadcasterId", "moderatorId", "createEventSubUserCondition", "userId", "createEventSubDropEntitlementGrantCondition", "filter", "createEventSubConduitCondition", "conduitId", "status", "createEventSubConduitUpdateCondition", "shardCount", "createEventSubConduitShardsUpdateCondition", "shards", "HelixEventSubSubscription", "DataObject", "__name", "data", "client", "rawDataSymbol", "status", "__decorate", "Enumerable", "rtfm", "HelixPaginatedEventSubSubscriptionsRequest", "HelixPaginatedRequestWithTotal", "__name", "query", "userId", "client", "data", "HelixEventSubSubscription", "__decorate", "rtfm", "HelixEventSubConduit", "DataObject", "__name", "data", "client", "rawDataSymbol", "shardCount", "__decorate", "Enumerable", "rtfm", "HelixEventSubConduitShard", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixEventSubApi", "BaseApi", "__name", "pagination", "result", "createPaginationQuery", "createPaginatedResultWithTotal", "HelixEventSubSubscription", "HelixPaginatedEventSubSubscriptionsRequest", "status", "type", "user", "extractUserId", "createSingleKeyQuery", "userId", "version", "condition", "transport", "requiredScopeSet", "canOverrideScopedUserContext", "isBatched", "usesAppAuth", "scopes", "jsonBody", "mapOptional", "id", "sub", "broadcaster", "createEventSubBroadcasterCondition", "broadcasterId", "createEventSubModeratorCondition", "rewardId", "createEventSubRewardCondition", "createEventSubUserCondition", "clientId", "withEmail", "filter", "createEventSubDropEntitlementGrantCondition", "data", "HelixEventSubConduit", "shardCount", "createEventSubConduitUpdateCondition", "conduitId", "createEventSubConduitCondition", "createPaginatedResult", "HelixEventSubConduitShard", "HelixPaginatedRequest", "shards", "createEventSubConduitShardsUpdateCondition", "cond", "subsPaginator", "__decorate", "rtfm", "createReleasedExtensionFilter", "extensionId", "version", "__name", "createExtensionProductBody", "data", "createExtensionTransactionQuery", "filter", "HelixChannelReference", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixExtensionBitsProduct", "DataObject", "__name", "rawDataSymbol", "mapNullable", "exp", "__decorate", "rtfm", "HelixExtensionTransaction", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixExtensionsApi", "BaseApi", "__name", "extensionId", "version", "result", "createReleasedExtensionFilter", "HelixExtension", "pagination", "createSingleKeyQuery", "createPaginationQuery", "createPaginatedResult", "HelixChannelReference", "HelixPaginatedRequest", "data", "includeDisabled", "HelixExtensionBitsProduct", "createExtensionProductBody", "filter", "createExtensionTransactionQuery", "HelixExtensionTransaction", "__decorate", "rtfm", "HelixGame", "DataObject", "__name", "data", "client", "rawDataSymbol", "width", "height", "pagination", "__decorate", "Enumerable", "rtfm", "HelixGameApi", "BaseApi", "__name", "HelixRequestBatcher", "data", "HelixGame", "ids", "names", "igdbIds", "id", "name", "igdbId", "pagination", "result", "createPaginationQuery", "createPaginatedResult", "HelixPaginatedRequest", "filterType", "filterValues", "entry", "__decorate", "Enumerable", "rtfm", "HelixGoal", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixGoalApi", "BaseApi", "__name", "broadcaster", "extractUserId", "createBroadcasterQuery", "data", "HelixGoal", "__decorate", "rtfm", "HelixHypeTrainContribution", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixHypeTrain", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "cont", "HelixHypeTrainContribution", "__decorate", "Enumerable", "rtfm", "HelixHypeTrainAllTimeHigh", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixHypeTrainStatus", "DataObject", "__name", "data", "client", "mapNullable", "rawDataSymbol", "HelixHypeTrain", "HelixHypeTrainAllTimeHigh", "__decorate", "Enumerable", "rtfm", "HelixHypeTrainApi", "BaseApi", "__name", "broadcaster", "result", "extractUserId", "createBroadcasterQuery", "HelixHypeTrainStatus", "createModerationUserListQuery", "channel", "filter", "extractUserId", "__name", "createModeratorModifyQuery", "broadcaster", "user", "createResolveUnbanRequestQuery", "moderator", "unbanRequestId", "approved", "resolutionMessage", "createAutoModProcessBody", "msgId", "allow", "createAutoModSettingsBody", "data", "createBanUserBody", "createUpdateShieldModeStatusBody", "activate", "createCheckAutoModStatusBody", "entry", "createWarnUserBody", "reason", "HelixAutoModSettings", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixAutoModStatus", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixBanUser", "DataObject", "__name", "data", "expiryTimestamp", "client", "rawDataSymbol", "mapNullable", "ts", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixBan", "HelixBanUser", "__name", "data", "client", "rawDataSymbol", "__decorate", "rtfm", "HelixBlockedTerm", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixModeratedChannel", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixModerator", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixShieldModeStatus", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixUnbanRequest", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "mapNullable", "val", "__decorate", "Enumerable", "rtfm", "HelixWarning", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixModerationApi", "BaseApi", "__name", "channel", "filter", "result", "extractUserId", "createModerationUserListQuery", "createPaginationQuery", "createPaginatedResult", "HelixBan", "HelixPaginatedRequest", "createBroadcasterQuery", "data", "user", "userId", "ban", "HelixModerator", "createSingleKeyQuery", "HelixModeratedChannel", "mod", "broadcaster", "createModeratorModifyQuery", "createCheckAutoModStatusBody", "statusData", "HelixAutoModStatus", "msgId", "allow", "createAutoModProcessBody", "broadcasterId", "HelixAutoModSettings", "createAutoModSettingsBody", "settingsData", "createBanUserBody", "banData", "HelixBanUser", "pagination", "HelixBlockedTerm", "text", "blockedTermData", "moderator", "id", "messageId", "HelixShieldModeStatus", "activate", "createUpdateShieldModeStatusBody", "status", "HelixUnbanRequest", "unbanRequestId", "approved", "resolutionMessage", "createResolveUnbanRequestQuery", "reason", "createWarnUserBody", "HelixWarning", "createModeratorActionQuery", "__decorate", "rtfm", "createPollBody", "broadcaster", "data", "extractUserId", "title", "__name", "createPollEndBody", "id", "showResult", "HelixPollChoice", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixPoll", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "HelixPollChoice", "__decorate", "Enumerable", "rtfm", "HelixPollApi", "BaseApi", "__name", "broadcaster", "pagination", "result", "extractUserId", "createBroadcasterQuery", "createPaginationQuery", "createPaginatedResult", "HelixPoll", "HelixPaginatedRequest", "data", "ids", "createGetByIdsQuery", "id", "polls", "createPollBody", "showResult", "createPollEndBody", "__decorate", "rtfm", "createPredictionBody", "broadcaster", "data", "extractUserId", "title", "__name", "createEndPredictionBody", "id", "status", "outcomeId", "HelixPredictor", "DataObject", "__name", "data", "client", "rawDataSymbol", "__decorate", "Enumerable", "rtfm", "HelixPredictionOutcome", "DataObject", "__name", "data", "client", "rawDataSymbol", "HelixPredictor", "__decorate", "Enumerable", "rtfm", "HelixPrediction", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "HelixPredictionOutcome", "found", "o", "HellFreezesOverError", "__decorate", "Enumerable", "rtfm", "HelixPredictionApi", "BaseApi", "__name", "broadcaster", "pagination", "result", "extractUserId", "createBroadcasterQuery", "createPaginationQuery", "createPaginatedResult", "HelixPrediction", "HelixPaginatedRequest", "data", "ids", "createGetByIdsQuery", "id", "predictions", "createPredictionBody", "outcomeId", "status", "createEndPredictionBody", "__decorate", "rtfm", "createRaidStartQuery", "from", "to", "extractUserId", "__name", "HelixRaid", "DataObject", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixRaidApi", "BaseApi", "__name", "from", "to", "result", "extractUserId", "createRaidStartQuery", "HelixRaid", "createBroadcasterQuery", "__decorate", "rtfm", "createScheduleQuery", "broadcaster", "filter", "extractUserId", "__name", "createScheduleSettingsUpdateQuery", "settings", "createScheduleSegmentBody", "data", "createScheduleSegmentModifyQuery", "segmentId", "createScheduleSegmentUpdateBody", "HelixScheduleSegment", "DataObject", "__name", "data", "client", "rawDataSymbol", "mapNullable", "v", "categoryId", "__decorate", "Enumerable", "rtfm", "HelixPaginatedScheduleSegmentRequest", "HelixPaginatedRequest", "__name", "broadcaster", "client", "filter", "createScheduleQuery", "data", "HelixScheduleSegment", "additionalOptions", "origData", "__decorate", "rtfm", "HelixSchedule", "DataObject", "__name", "data", "client", "rawDataSymbol", "HelixScheduleSegment", "checkRelationAssertion", "timestamp", "__decorate", "Enumerable", "rtfm", "HelixScheduleApi", "BaseApi", "__name", "broadcaster", "filter", "result", "extractUserId", "createScheduleQuery", "createPaginationQuery", "HelixSchedule", "HelixPaginatedScheduleSegmentRequest", "ids", "createGetByIdsQuery", "data", "HelixScheduleSegment", "id", "segments", "createBroadcasterQuery", "settings", "createScheduleSettingsUpdateQuery", "createScheduleSegmentBody", "segmentId", "createScheduleSegmentModifyQuery", "createScheduleSegmentUpdateBody", "createSearchChannelsQuery", "query", "filter", "__name", "HelixChannelSearchResult", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixSearchApi", "BaseApi", "__name", "query", "pagination", "result", "createPaginationQuery", "createPaginatedResult", "HelixGame", "HelixPaginatedRequest", "data", "filter", "createSearchChannelsQuery", "HelixChannelSearchResult", "__decorate", "rtfm", "StreamNotLiveError", "CustomError", "__name", "options", "createStreamQuery", "filter", "__name", "createStreamMarkerBody", "broadcaster", "description", "extractUserId", "createVideoQuery", "id", "HelixStream", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "width", "height", "__decorate", "Enumerable", "rtfm", "HelixStreamMarker", "DataObject", "__name", "data", "client", "rawDataSymbol", "__decorate", "Enumerable", "rtfm", "HelixStreamMarkerWithVideo", "HelixStreamMarker", "__name", "data", "_videoId", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "rtfm", "HelixStreamApi_1", "HelixStreamApi", "BaseApi", "__name", "HelixRequestBatcher", "data", "HelixStream", "filter", "result", "createStreamQuery", "createPaginationQuery", "createPaginatedResult", "HelixPaginatedRequest", "users", "extractUserName", "user", "extractUserId", "userId", "mapNullable", "pagination", "createUserQuery", "flatten", "videoId", "createVideoQuery", "broadcaster", "description", "createStreamMarkerBody", "HelixStreamMarker", "e", "HttpStatusCodeError", "StreamNotLiveError", "createBroadcasterQuery", "createSingleKeyQuery", "client", "video", "marker", "HelixStreamMarkerWithVideo", "__decorate", "Enumerable", "rtfm", "createSubscriptionCheckQuery", "broadcaster", "user", "extractUserId", "__name", "HelixUserSubscription", "DataObject", "__name", "data", "client", "rawDataSymbol", "__decorate", "Enumerable", "rtfm", "HelixSubscription", "HelixUserSubscription", "__name", "rawDataSymbol", "checkRelationAssertion", "__decorate", "rtfm", "HelixPaginatedSubscriptionsRequest", "HelixPaginatedRequestWithTotal", "__name", "broadcaster", "client", "extractUserId", "createBroadcasterQuery", "data", "HelixSubscription", "__decorate", "rtfm", "HelixSubscriptionApi", "BaseApi", "__name", "broadcaster", "pagination", "result", "extractUserId", "createBroadcasterQuery", "createPaginationQuery", "createPaginatedResultWithTotal", "HelixSubscription", "HelixPaginatedSubscriptionsRequest", "users", "createChannelUsersCheckQuery", "data", "user", "list", "createSubscriptionCheckQuery", "HelixUserSubscription", "e", "HttpStatusCodeError", "__decorate", "rtfm", "HelixTeam", "DataObject", "__name", "data", "client", "rawDataSymbol", "__decorate", "Enumerable", "rtfm", "HelixTeamWithUsers", "HelixTeam", "__name", "rawDataSymbol", "data", "HelixUserRelation", "__decorate", "rtfm", "HelixTeamApi", "BaseApi", "__name", "broadcaster", "extractUserId", "createBroadcasterQuery", "data", "HelixTeam", "id", "result", "HelixTeamWithUsers", "e", "HttpStatusCodeError", "name", "__decorate", "rtfm", "createUserBlockCreateQuery", "target", "additionalInfo", "extractUserId", "__name", "createUserBlockDeleteQuery", "HelixBaseExtension", "DataObject", "__name", "rawDataSymbol", "HelixInstalledExtension", "HelixBaseExtension", "__name", "slotType", "slotId", "data", "__decorate", "rtfm", "HelixInstalledExtensionList", "DataObject", "__name", "type", "slotId", "data", "rawDataSymbol", "HelixInstalledExtension", "entry", "slotData", "typeEntries", "__decorate", "rtfm", "HelixUserExtension", "HelixBaseExtension", "__name", "rawDataSymbol", "__decorate", "rtfm", "HelixUser", "DataObject", "__name", "data", "client", "rawDataSymbol", "broadcaster", "user", "__decorate", "Enumerable", "rtfm", "HelixPrivilegedUser", "HelixUser", "__name", "rawDataSymbol", "description", "__decorate", "rtfm", "HelixUserBlock", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "__decorate", "Enumerable", "rtfm", "HelixUserApi", "BaseApi", "__name", "HelixRequestBatcher", "data", "HelixUser", "userIds", "extractUserId", "userNames", "extractUserName", "user", "userId", "result", "mapNullable", "userName", "users", "withEmail", "HellFreezesOverError", "HelixPrivilegedUser", "pagination", "createBroadcasterQuery", "createPaginationQuery", "createPaginatedResult", "HelixUserBlock", "HelixPaginatedRequest", "broadcaster", "target", "additionalInfo", "createUserBlockCreateQuery", "createUserBlockDeleteQuery", "withInactive", "HelixUserExtension", "withDev", "createSingleKeyQuery", "HelixInstalledExtensionList", "lookupType", "param", "query", "userData", "__decorate", "Enumerable", "rtfm", "HelixVideo", "DataObject", "__name", "data", "client", "rawDataSymbol", "checkRelationAssertion", "width", "height", "parts", "HellFreezesOverError", "part", "partialMatch", "num", "unit", "a", "b", "offset", "duration", "partial", "seg", "end", "segEnd", "__decorate", "Enumerable", "CachedGetter", "Cacheable", "rtfm", "HelixVideoApi_1", "HelixVideoApi", "BaseApi", "__name", "HelixRequestBatcher", "data", "HelixVideo", "ids", "id", "videos", "user", "filter", "userId", "extractUserId", "gameId", "broadcaster", "filterType", "filterValues", "result", "createPaginationQuery", "createPaginatedResult", "HelixPaginatedRequest", "language", "period", "orderBy", "type", "__decorate", "Enumerable", "rtfm", "createWhisperQuery", "from", "to", "extractUserId", "__name", "HelixWhisperApi", "BaseApi", "__name", "from", "to", "message", "extractUserId", "createWhisperQuery", "__decorate", "rtfm", "ApiReportedRequest", "__name", "_options", "_httpStatus", "_resolvedUserId", "BaseApiClient", "EventEmitter", "__name", "config", "logger", "rateLimiter", "user", "scopes", "scope", "data", "TokenInfo", "HttpStatusCodeError", "InvalidTokenError", "options", "authProvider", "callTwitchApi", "forceUser", "accessToken", "HellFreezesOverError", "contextUserId", "accessTokenIsExpired", "newAccessToken", "requestContextUserId", "HelixBitsApi", "HelixChannelApi", "HelixChannelPointsApi", "HelixCharityApi", "HelixChatApi", "HelixClipApi", "HelixContentClassificationLabelApi", "HelixEntitlementApi", "HelixEventSubApi", "HelixExtensionsApi", "HelixGameApi", "HelixHypeTrainApi", "HelixGoalApi", "HelixModerationApi", "HelixPollApi", "HelixPredictionApi", "HelixRaidApi", "HelixScheduleApi", "HelixSearchApi", "HelixStreamApi", "HelixSubscriptionApi", "HelixTeamApi", "HelixUserApi", "HelixVideoApi", "HelixWhisperApi", "ResponseBasedRateLimiter", "wasRefreshed", "authorizationType", "response", "token", "ApiReportedRequest", "handleTwitchApiResponseError", "transformTwitchApiResponse", "clientId", "fetchOptions", "type", "op", "promise", "resolve", "reject", "promiseWithResolvers", "callTwitchApiRaw", "e", "result", "__decorate", "CachedGetter", "Cacheable", "rtfm", "NoContextApiClient", "BaseApiClient", "__name", "__decorate", "rtfm", "UserContextApiClient", "BaseApiClient", "__name", "config", "logger", "rateLimiter", "_userId", "__decorate", "rtfm", "ApiClient", "BaseApiClient", "__name", "config", "ConfigError", "rateLimitLoggerOptions", "createLogger", "PartitionedRateLimiter", "req", "HelixRateLimiter", "PartitionedTimeBasedRateLimiter", "options", "clientId", "accessToken", "authorizationType", "fetchOptions", "callTwitchApiRaw", "user", "runner", "ctx", "UserContextApiClient", "extractUserId", "intents", "intent", "NoContextApiClient", "__decorate", "rtfm", "EmoteFetcher", "__name", "options", "authProvider", "AppTokenAuthProvider", "ApiClient", "Collection_default", "channelId", "format", "channel", "Channel_default", "id", "data", "existingEmote", "emote", "TwitchEmote_default", "endpoint", "Constants_default", "response", "BTTVEmote_default", "emotes", "key", "set", "FFZEmote_default", "SevenTVEmote_default", "rawEmotes", "e", "emotesArray", "classMap", "emoteObject", "type", "emoteClass", "EmoteFetcher_default", "EmoteParser", "__name", "fetcher", "options", "text", "size", "forceStatic", "themeMode", "matched", "id", "emote", "template", "Constants_default", "link", "EmoteParser_default", "index_default", "BTTVEmote_default", "Channel_default", "Collection_default", "Constants_default", "Emote_default", "EmoteFetcher_default", "EmoteParser_default", "FFZEmote_default", "SevenTVEmote_default", "TwitchEmote_default"]
|
|
7
|
+
}
|