/* Metro module 13940; source: components_native/ChangeLogModal.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 661, 1933, 33, 4501, 697, 3868, 9544, 683, 13941, 5475, 9543, 1244, 5278, 8792, 11059, 1305, 8336, 1478, 8337, 1485, 5282, 3738, 8338, 4573, 5080, 5280, 2] */ import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */ import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */ import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */ import UseWindowDimensionsNative from '../modules/screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */ import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as ReactModule from '../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as JsxRuntimeModule from '../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */ import * as IndexNativeModule from '../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as Module01485Module from '../by-id/module-01485.js'; /* Metro dependency 1485 */ import * as ChangelogConstantsModule from '../modules/changelog/ChangelogConstants.tsx'; /* Metro dependency 1933 */ import * as NativeModule from '../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */ import * as CreateStylesModule from '../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as TextModule from '../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */ import * as PressablesModule from '../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */ import * as NavigatorNativeModule from '../design/components/Navigator/native/Navigator.native.tsx'; /* Metro dependency 5280 */ import * as NavigatorHeaderNativeModule from '../design/components/Navigator/native/NavigatorHeader.native.tsx'; /* Metro dependency 5282 */ import * as UseCurrentChangelogModule from '../modules/changelog/useCurrentChangelog.tsx'; /* Metro dependency 8337 */ function _fun105809(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#105809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:6, offset: 0x022c34d8, size: 831 bytes, params: 8, frame: 25 const env0_0 = require; const ChangeLogScreen2 = ChangeLogScreen; const hideChangeLog = function() { importDefault(dependencyMap[31]).popWithKey(CHANGELOG_MODAL_KEY); }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles; object = {}; object.video = {alignSelf: 'center'}; object.videoWrapper = {marginBottom: 8}; const object4 = {}; object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs; object4.overflow = 'hidden'; object.videoSpecial = object4; object.videoOverlay = {'position': 'absolute', 'width': '100%', 'height': '100%'}; const object5 = {'position': 'absolute', 'top': '50%', 'left': '50%', 'marginLeft': -28, 'marginTop': -28, 'borderRadius': null, 'backgroundColor': null, 'width': 56, 'height': 56}; object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round; const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH; object5.backgroundColor = BACKGROUND_SURFACE_HIGH; object.playButton = object5; object.playIcon = {'width': 21, 'height': 21}; object.empty = {'width': '100%', 'height': 240, 'alignItems': 'center', 'paddingTop': 48}; const env0_15 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]); createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles; object = {}; const BACKGROUND_MOD_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG; object.bulletPoint = {'width': 7, 'height': 7, 'borderRadius': 3.5, 'marginRight': 13, 'marginTop': 7, backgroundColor: BACKGROUND_MOD_STRONG}; object.listItem = {'flexDirection': 'row', 'marginLeft': 4, 'marginBottom': 8}; const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT; object.listText = {'color': null, 'fontSize': 14, 'lineHeight': 18, 'flex': 1, color: TEXT_DEFAULT}; object.listItemContent = {'flexDirection': 'column', 'flex': 1}; const env0_16 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]); let PureComponent = ReactModule.PureComponent; const value5 = _fun105821(PureComponent); const ThemeContext = (NativeModule).ThemeContext; value5.contextType = ThemeContext; PureComponent = ReactModule.PureComponent; _fun105824(PureComponent).contextType = ThemeContext; (FileImportTrackerModule).fileFinishedImporting('components_native/ChangeLogModal.tsx'); exports.default = ChangelogModal; exports.ListItem = value5; exports.ChangeLogScreen = ChangeLogScreen2; function _callSuper_105810(a0, a1, a2) { // fn#105810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:255, offset: 0x022c3817, size: 100 bytes, params: 4, frame: 20 var r0; var Reflect; let value = a2; const value3 = Module00017(a1); if (_isNativeReflectConstruct_105811()) { Reflect = global.Reflect; value = Reflect.construct(value3, value || [], Module00017(a0).constructor); r0 = value; } else { value = value3.apply(a0, value); r0 = value; } return PossibleConstructorReturn(a0, r0); } function _isNativeReflectConstruct_105811() { // fn#105811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:386, offset: 0x022c387b, size: 98 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_105811_isNativeReflectConstruct = function() { return !!result; })(); } function ChangeLogScreen({onClose}) { // fn#105814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:4511, offset: 0x022c38dd, size: 666 bytes, params: 2, frame: 25 var r0; const Text = (TextModule).Text; var object; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var string; var t; const value2 = (CreateStylesModule).useLegacyClassComponentStyles(env0_15); const {changelog, loaded, clientTooOld} = (UseCurrentChangelogModule).useCurrentChangelog(); let {width, height} = (UseWindowDimensionsNative)(); const value5 = width - 36; const value6 = value5 * env0_14; const value7 = 0.5 * height; const object2 = {}; const Math = global.Math; object2.height = Math.min(value6, value7); object2.width = value6 > value7 ? value7 / env0_14 : value5; width = object2.width; height = object2.height; const value9 = (Module01485Module).useNavigation(); const r10 = onClose ?? ChangeLogScreenE; env0_8.useEffect(_fun105816, [changelog, value9]); env0_8.useEffect(function() { if (loaded) { if (changelog != null) { return _fun105819; } } }, [loaded, changelog]); if (clientTooOld) { r0 = ( {intl.string((require(1244) /* metro dependency 1244: indexNative */).t.V9ospk)} ); } else if (changelog == null) { var viewBindingProps = {style: value2.empty}; object = {variant: 'text-md/semibold'}; string = intl.string; t = (require(1244) /* metro dependency 1244: indexNative */).t; if (loaded) { viewBindingProps.children = ( {Reflect.apply(string, intl, [t.O1iRT8])} ); } else { viewBindingProps.children = ( {Reflect.apply(string, intl, [t.ZTNur7])} ); } r0 = ; } else { r0 = ((Component) => )(env0_17); } return r0; function ChangeLogScreenE() { // fn#105815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:4877, owner: ChangeLogScreen.e, offset: 0x022c3b77, size: 19 bytes, params: 1, frame: 9 return env0_2.goBack(); } function _fun105816() { // fn#105816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:4906, offset: 0x022c3b8a, size: 48 bytes, params: 1, frame: 12 var binding; if (changelog != null) { binding = env0_2; binding.setOptions({headerTitle: headerTitle_105817}); } function headerTitle_105817() { // fn#105817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:4946, offset: 0x022c3bba, size: 267 bytes, params: 1, frame: 22 var r8; let value = environment.__proto__.__proto__; const NavigatorHeader = (NavigatorHeaderNativeModule).NavigatorHeader; const intl = (IndexNativeModule).intl; const string = intl.string; const LRmNAl = (IndexNativeModule).t.LRmNAl; const formatToPlainString = intl.formatToPlainString; const Fb8xx2 = (IndexNativeModule).t.Fb8xx2; if (changelog.date == null) { r8 = new global.Date(); } else if (changelog.date !== '') { value = importDefault(3738) /* metro dependency 3738 */; value = value(changelog.date); value = value.toDate(); r8 = value; } else { r8 = new global.Date(); } return ( ); } } function _fun105818() { // fn#105818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:5180, offset: 0x022c3cc5, size: 35 bytes, params: 1, frame: 2 if (loaded) { if (changelog != null) { return _fun105819; } } function _fun105819() { // fn#105819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:5205, offset: 0x022c3ce8, size: 57 bytes, params: 1, frame: 13 let value = environment.__proto__.__proto__; value = importDefault(8338) /* metro dependency 8338: ChangeLogActionCreators */; const markChangelogAsSeen = value.markChangelogAsSeen; const changelogBinding = changelog; return Reflect.apply(markChangelogAsSeen, value, [changelogBinding.id, changelogBinding.date]); } } } function _fun105821(a0) { // fn#105821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:1473, offset: 0x022c3d4b, size: 72 bytes, params: 2, frame: 15 const ListItem_1058222 = ListItem_105822; Inherits(ListItem_1058222, a0); return CreateClass(ListItem_1058222, [{key: 'render', value: value_105823}]); function ListItem_105822() { // fn#105822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:1485, offset: 0x022c3d93, size: 42 bytes, params: 1, frame: 16 env1_3(this, ListItem_105822); return _callSuper_105810(this, ListItem_105822, arguments); } function value_105823() { // fn#105823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:1618, offset: 0x022c3dbd, size: 163 bytes, params: 1, frame: 22 const children = this.props.children; const value = environment.__proto__; const value2 = env1_16(this.context); return ( {typeof children !== 'function' ? children : children({style: value2.listText})} ); } } function _fun105824(a0) { // fn#105824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:1884, offset: 0x022c3e60, size: 172 bytes, params: 2, frame: 16 const ChangeLog2 = ChangeLog; Inherits(ChangeLog2, a0); return CreateClass(ChangeLog2, [{key: 'componentDidMount', value: function() { var Date = global.Date; this.mountedAt = Date.now(); this.track(AnalyticEvents.CHANGE_LOG_OPENED); }}, {key: 'componentWillUnmount', value: function() { this.track(AnalyticEvents.CHANGE_LOG_CLOSED); }}, {key: 'track', value: value_105830}, {key: 'renderVideo', value: value_105831}, {key: 'render', value: value_105834}]); function ChangeLog(a0) { // fn#105825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:1896, offset: 0x022c3f0c, size: 141 bytes, params: 2, frame: 19 let value = copyRestArgs(0, undefined); env1_3(this, ChangeLog); const _callSuper_105810Binding = _callSuper_105810; const items2 = []; arraySpread(items2, value, 0, value); value = _callSuper_105810Binding(this, ChangeLog, items2); value.mountedAt = 0; value.ref = env1_8.createRef(); value.maxScrolledPercentage = 0; value.state = {ytVideoReady: false}; value.handleScroll = handleScroll_105826; value.playVideo = playVideo; return value; function ChangeLogHandleScroll({contentOffset, layoutMeasurement, contentSize}) { // fn#105826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:2089, owner: ChangeLog.handleScroll, offset: 0x022c3f99, size: 106 bytes, params: 2, frame: 16 let value = contentOffset.y + layoutMeasurement.height; value /= contentSize.height; const binding = env0_0; const Math = global.Math; const min = Math.min; const Math2 = global.Math; value = Math2.max(binding.maxScrolledPercentage, value); binding.maxScrolledPercentage = Reflect.apply(min, Math, [value, 1]); } function playVideo() { // fn#105827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:2252, owner: ChangeLog.playVideo, offset: 0x022c4003, size: 218 bytes, params: 1, frame: 18 var openMediaModal; var object2; const {changeLog, width, height} = env0_0.props; const video = changeLog.video; const image = changeLog.image; if (video == null) { if (image == null) { return null; } } const r5 = video != null ? {videoURI: video} : {uri: image}; const binding = env0_0; const track = binding.track; let value = environment.__proto__.__proto__; const CHANGE_LOG_VIDEO_INTERACTED = AnalyticEvents.CHANGE_LOG_VIDEO_INTERACTED; Reflect.apply(track, binding, [CHANGE_LOG_VIDEO_INTERACTED]); const current = binding.ref.current; if (current != null) { value = require(9544) /* metro dependency 9544: openMediaModal */; openMediaModal = value.openMediaModal; object2 = {}; copyDataProperties(object2, r5, width); object2['width'] = width; object2['height'] = height; Reflect.apply(openMediaModal, value, [{'initialSources': null, 'disableDownload': true, 'shareable': false, 'analyticsSource': 'Change Log', initialSources: [object2], originViewOrOriginLayout: current}]); } } } function value_105830(a0) { // fn#105830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:2855, offset: 0x022c4130, size: 267 bytes, params: 2, frame: 22 var r3; var object; var object2; var Math; let value = a1; const r1 = value !== undefined ? value : {}; const changeLog = this.props.changeLog; if (changeLog != null) { object = {}; object.change_log_id = '' + changeLog.date + ':' + changeLog.revision; copyDataProperties(object, r1, undefined); value = environment.__proto__; if (a0 !== AnalyticEvents.CHANGE_LOG_CLOSED) { r3 = object; } else { object2 = {}; Math = global.Math; object2.seconds_open = Math.round((global.Date.now() - this.mountedAt) / 1000); object2.max_scrolled_percentage = 100 * global.parseInt(this.maxScrolledPercentage.toPrecision(4), 10); copyDataProperties(object2, object, undefined); r3 = object2; } value = importDefault(683) /* metro dependency 683: AnalyticsUtils */; value.track(a0, r3); } } function value_105831() { // fn#105831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14137:3188, offset: 0x022c423b, size: 766 bytes, params: 1, frame: 34 var environment; var r7; var r0; var object2; var r8; var items3; var Video; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var items2; const PressableOpacity = (PressablesModule).PressableOpacity; var playVideo; let value = environment.__proto__; const value2 = env1_15(this.context); const {changeLog, width, height, onClose} = this.props; const video = changeLog.video; const image = changeLog.image; const youtube_video_id = changeLog.youtube_video_id; const ytVideoReady = this.state.ytVideoReady; const value3 = null; if (value3 != video) { object2 = {videoURI: video}; var viewBindingProps = {style: value2.videoWrapper, onAccessibilityEscape: onClose}; var viewBinding2Props = {ref: this.ref, style: value2.videoSpecial}; Video = importDefault(9543) /* metro dependency 9543: Video */; items2 = [